Using C#, how does one figure out what process locked a file?

前端 未结 9 1968
死守一世寂寞
死守一世寂寞 2020-11-22 13:03

In Windows, how do I determine (using C#) what process locked a file?

Third-party tools are helpful, but not what I\'m looking for.

9条回答
  •  心在旅途
    2020-11-22 13:33

    Handle, from Windows Sysinternals. This is a free command-line utility provided by Microsoft.

    You could run it, and parse the result.

提交回复
热议问题