if (FileUpload1.FileContent.Length > 0)
{
string name = FileUpload1.FileName;//获取上传的文件名
string ext = System.IO.Path.GetExtension(name);// 获取文件的扩展名,比如 .gif
string newname = DateTime.Now.ToString("yyyyMMddhhmmss") +ext;//利用时间生成新文件名后再加扩展名生成完整名字
string path = "~/load/" + newname;
FileUpload1 .SaveAs (System .Web .HttpContext .Current .Server .MapPath (path ));
}