1 客户端IP地址
txtIP.Text= Request.UserHostAddress;
2 创建随机数对象
Random rnd = new Random();
//调用Next方法产生随机数
txtRnd.Text = rnd.Next(1,20).ToString();
3 //取得指定的文件路径
string path = txtExtName.Text.Trim();
//txtExtName.Text = Path.GetExtension(path);
//取得指定路径中文件的扩展名
txtExtName.Text = path. Substring(path.LastIndexOf(".")+1);
4 txtExtName.Text = Path.GetExtension(selFile.PostedFile.FileName);
5 txtCurDate.Text = DateTime.Now.ToShortDateString();