E
eugenet
Hello,
This is probably a newbie question.
In my C# program, when I try to delete a file, I get an exception that
the file is locked by another process. I would like to terminate the
process that locks the file.
How can I determine what process has a lock on a file, just based on
the file path? If you have an example in .NET, that would be super, but
if you could explain it in Windows API terms, that will do as well.
Thanks for your help!
Evgueni
PS. I have to be able to solve this programmatically -- sysinternals'
tools cannot be used
This is probably a newbie question.
In my C# program, when I try to delete a file, I get an exception that
the file is locked by another process. I would like to terminate the
process that locks the file.
How can I determine what process has a lock on a file, just based on
the file path? If you have an example in .NET, that would be super, but
if you could explain it in Windows API terms, that will do as well.
Thanks for your help!
Evgueni
PS. I have to be able to solve this programmatically -- sysinternals'
tools cannot be used