Solution: The process cannot access the file [filename] because it is being used by another process.

http://www.brianstevenson.com/blog/solution-the-process-cannot-access-the-file-filename-because-it-is-being-used-by-another-process

在website上提交了请求,系统生成个文件并发往用户邮箱后发现该文件删除不了。明明是同一个进程,却提示被另一个进程占用。必须要recycle了application pool才能手动删除。

原来是因为发邮件的message需要在发送后diapost()后才可以。

MailMessage mail = new MailMessage();
。。。
mail.Dispose();

 

Process Monitor v3.1
http://technet.microsoft.com/en-us/sysinternals/bb896645

process monitor 使用教程
http://baoku.yunduan.cn/d/artitem/2274/1/9/0/432/


Portmon for Windows v3.03
http://technet.microsoft.com/en-us/sysinternals/bb896644


DiskMon for Windows v2.01
http://technet.microsoft.com/en-us/sysinternals/bb896646


DebugView v4.81

http://technet.microsoft.com/en-us/sysinternals/bb896647

posted on 2014-03-28 15:01  白马酒凉  阅读(172)  评论(0编辑  收藏  举报

导航