0

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.

Pratik Ratanpara
  • 338
  • 2
  • 15
  • 1
    As far as I know, you cannot do it in C#. This is quite a very advanced topic, and you need C or C++ for it. You need something called File System Filter. You may look at this https://www.codeproject.com/Articles/43586/File-System-Filter-Driver-Tutorial#_Toc244423398 – Kim Hoang Dec 21 '16 at 07:10
  • Possible duplicate of [Intercept FIleSytemCall for Deletion](http://stackoverflow.com/questions/10727844/intercept-filesytemcall-for-deletion) – Sefe Dec 21 '16 at 07:12
  • hey Kim Hoang , I visit your link but i can't understand. can you please help me to implement File System Filter Driver – Pratik Ratanpara Dec 21 '16 at 11:26

1 Answers1

1

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.

anion
  • 1,516
  • 1
  • 21
  • 35