//文件名
string fName = string.Format("{0}{1}", DateTime.Now.ToString(CommonDefine.DATETIME_FORMAT_LIST),
this.fUpload.PostedFile.FileName.Substring(this.fUpload.PostedFile.FileName.LastIndexOf(".")));
if (!Directory.Exists(Server.MapPath("XSL")))
{
Directory.CreateDirectory(Server.MapPath("XSL"));
}
string path = Server.MapPath(string.Format("XSL\{0}", fName));//待读取Excel的全路径,临时文件路径
this.fUpload.PostedFile.SaveAs(path);//将上传文件重新保存在XSL临时文件夹下
//do sth
//删除临时文件
//把上传的文件删除
if (File.Exists(Server.MapPath(string.Format("XSL\{0}", fName))))
{
File.Delete(Server.MapPath(string.Format("XSL\{0}", fName)));
}