Click here to Skip to main content
15,906,329 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Hi every one

I want to write an AV in VC# but I don't know how I can monitor FileSystem events like opening a file, reading, creating, ...
C# FileSystem Class doesn't give me enough control. I want to make something like scanner driver (Windows Driver Kit) in C#.

I searched Google but I couldn't find any thing useful. They don't have on access time scan. They have just manual scan.

Thanks.
Posted

 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 25-May-11 10:18am    
Hope looking at these discussion will be sobering... :-) My 5.
--SA
If you do not have the knowledge to program in C++ or C# and the understanding on how to scan for patterns in files and analyzes how a program behave. Then do not try :-)
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 25-May-11 10:13am    
Good idea. I would advice to give up, too. My 5.
--SA
You're not making a driver in C#. It would be easier to learn C/C++ and use the Driver SDK than it would to rewrite sections of the SDK in C# so you can make a driver in C#.

An application like this is not just a simple C# app and hoping that you can use a couple of events to trigger your code.

FAR, FAR from it.

The FileSystemWatcher watches the FILE SYSTEM, not the files in it. Since reading a file does not change the file system, there's nothing for the FileSystemWatcher to notify you of.

In order to write this, you need an in-depth knowledge of Windows internals and NTFS. I suggest start reading these:

Windows Internals - Part 1[^]
Windows Internals - Part 2[^]
Inside Windows Debugging[^] - because you're not going to be able to get away from using WinDbg.
Advanced Windows Debugging[^] - you ARE going to be doing kernel-level debugging for a project like this.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900