【发布时间】:2013-03-12 06:05:17
【问题描述】:
以下是我在删除目录时从网络服务获得的异常
The process cannot access the file 'button.js' because it is being used by another process.
3/22/2013 11:16:51 AM : Exception :The process cannot access the file 'button.js' because it is being used by another process.
内部异常:
堆栈跟踪:
在 System.IO.Directory.DeleteHelper(String fullPath, String userPath, Boolean recursive) 在 System.IO.Directory.Delete(字符串 fullPath,字符串 userPath,布尔递归) 在 System.IO.Directory.Delete(字符串路径,布尔递归) 在 E:\websites\test.cont.com\CRMobileAPI\v5_2\apibridge.asmx.cs:line 1213 中的 CRMobileAPI.v5_2.apibridge.downloadcompleted(String userid, String deviceid, String filepathurl)
来源:
mscorlib
这是我的代码,
if (Directory.Exists(_DirPath))
{
try
{
DirectoryInfo _DirTemp = new DirectoryInfo(_DirPath);
_DirTemp.Delete(true);
}
catch (Exception Ex)
{
clsExHandler.Instance.Write(Ex);
}
}
注意:此异常不仅适用于“button.js”,而且会随时间变化。
我该如何解决这个问题;我的记录器文件遇到了这个异常。
【问题讨论】:
标签: c#-4.0 iis-7.5 fileinfo directoryinfo