日期:2014-05-17 浏览次数:20472 次
// save the post file to session
List<HttpPostedFile> postFiles = Session["file_data"] as List<HttpPostedFile>;
if (postFiles == null)
{
postFiles = new List<HttpPostedFile>();
Session["file_data"] = postFiles;
}
postFiles.Add(postFile);
if (Session["file_data"] != null)
{
...;
List<HttpPostedFile> postFiles = Session["file_data"] as List<HttpPostedFile>;
...;
foreach (HttpPostedFile postFile in postFiles)
{
...;
postFile.SaveAs(strPath); //这句被catch出来错误:cann't access closed file
...;
}
}