以下是我在删除目录时从我的网络服务获得的异常
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) at System.IO.Directory.Delete(String fullPath, String userPath, Boolean recursive) at System.IO.Directory.Delete(String path, Boolean recursive) ) 在 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”,而且会随时间变化。
我该如何摆脱这个问题;我的记录器文件卡住了这个异常。