Lou*_*hys 8 .net windows file-access
我一直在我的程序中得到这个例外.我怎么知道哪个进程锁定了它,无论是通过程序代码还是通过Windows做某事?
System.IO.IOException : The process cannot access the file 'file.ext' because it is being used by another process.
Jus*_*tin 10
您可以使用ProcessExplorer搜索文件:
只需运行它(可能需要使用管理员权限启动它),点击Ctrl-F并输入被锁定文件的名称 - 它将找到与给定名称匹配的所有打开句柄,并告诉您它属于哪个进程.