开发者

How to access a file that is being used by another process in Windows?

I see that this question has been asked many times in stackoverflow, as well as in other places. The questioners solved their problem by different methods. Most of these solutions are around 开发者_Python百科how they designed their applications and locking level on the files.

I understand that Windows provides Read/Write protection in different ways. But, still, if the file is on my disk, and being an administrator, can't I read the contents of the locked file forcefully? Any pointers on how I can achieve that would be greatly helpful.

The file in question is totally inaccessible to other processes through C# .NET APIs. Looks like its readlocked.

Thanks.


If file is locked from your app, you have to close all buffers/streams or whatever you have opened before.

If file is locked from something else the only solution I know is to use Unlocker, which can be run even without GUI using some console param (so using Process class in C#).
But be careful to walk this way, because you could corrupt file and create some memory leak closing with brute force opened handles and probably application that was using them.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜