如何在c#中查看目录是否实际打开?
答案 0 :(得分:1)
您没有回复我的评论,但如果您因为锁定案例而需要它,那么请阅读此类问题:
How to identify whether folder is opened?
和那些2:
How do I find out which process is locking a file using .NET?
Using C#, how does one figure out what process locked a file?
您可以将CheckAccess用作:
bool CheckAccess
{
try
{
// If no access it will throw an exception
Directory.Move("old","new");
return true;
}
catch ( IOException )
{
return false;
}
}
答案 1 :(得分:0)