File is used by another process. How to know which process?

后端 未结 3 1836
小蘑菇
小蘑菇 2020-12-16 23:25

I keep getting that exception in my program. How do I know which process locked it, either by program code or by doing something with windows?

System.IO.IOExce

3条回答
  •  温柔的废话
    2020-12-16 23:48

    You can use ProcessExplorer to search for the file:

    • http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx

    Just run that (maybe you need to launch it with administrator rights), hit Ctrl-F and type in the name of the file which is locked - it will find all open handles which match the given name, and tell you which process it belongs to.

提交回复
热议问题