c# - How to identify whether folder is opened? -


In my application I am trying to rename the folder, but if the folder is opened in Windows Explorer, Code> IOException . How can I identify that the folder has been opened in C # in Windows Explorer?

Capturing IOException?

As others have said, just try to do whatever you like, grab the exception if this happens and take appropriate action, whatever in your context.

You really do not like it much as I see, but consider:

  bool iHaveAccess = CheckAccess (folder); If (iHaveAccess) {RenameFolder (folder, newFolderName); }  

What happens if RenameFolder locks some other folders in order to succeed and call between CheckAccess? then what will happen?


Comments

Popular posts from this blog

c# - TypeConverter in propertygrid only converts from string, not to -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -