Search code examples
c#windowsfile-permissionskeyboard-hookrights-management

Regarding file permission in C#


I have an issue regarding file permission. I am continuously watching on one folder {Workspace} using FileSystemWatcher. When I am trying to delete file from workspace, Watcher will give me deleted event after file is deleted.

I want to hook file delete event of windows. when user try to delete file from workspace then my custom message pop-up and ask user for confirmation "Are you sure you want to delete the file ??" if user press 'YES' then n then file is deleted otherwise do nothing.

So, please help me to introduce my custom message when user try to delete file from my workspace.


Solution

  • this is not possible by using filesystemwatcher. with a filesystemwatcher, you can watch and receive events, but it is not a hook to manipulate the functionality of windows.