System.IO.File.Create 不会自动释放,一定要Dispose

这样会导致W3P进程一直占用这个文件

System.IO.File.Create(HttpContext.Current.Server.MapPath(strName)) 

最好加上Dispose

System.IO.File.Create(HttpContext.Current.Server.MapPath(strName)).Dispose()

原文地址:https://www.cnblogs.com/LCX/p/4307845.html