Question About an Event Hook

  • Thread starter Thread starter needin4mation
  • Start date Start date
N

needin4mation

Hi, had a question about event hooks. I don't know that much about it
so please forgive me if I don't use all the right words. Is it
possible to use a hook that listens or watches a certain
directory/folder and when a new file is put into that directory take
some action.

I have a third party tool. It puts its log files in a directory on the
computer (XP Professional). I need some functionality the third party
does not provide. I can do this by reading the log files. The program
puts a new log file in for each transaction it completes, so what I
thought I could do is read the directory when a new file is put in the
directory and do whatever.

The only other thing I could think of was to use the task scheduler and
have my c# program do what I needed minus the event hook. It just
wouldn't be real time.

Thank you for any help or advice.
 
Hi, had a question about event hooks. I don't know that much about it
so please forgive me if I don't use all the right words. Is it
possible to use a hook that listens or watches a certain
directory/folder and when a new file is put into that directory take
some action.

I have a third party tool. It puts its log files in a directory on the
computer (XP Professional). I need some functionality the third party
does not provide. I can do this by reading the log files. The program
puts a new log file in for each transaction it completes, so what I
thought I could do is read the directory when a new file is put in the
directory and do whatever.

The only other thing I could think of was to use the task scheduler and
have my c# program do what I needed minus the event hook. It just
wouldn't be real time.

Thank you for any help or advice.

Research the FileSystemWatcher class. It should be able to provide the
"hooks" you're looking for.

Chris
 
Hi

The component you are after is called FileSystemWatcher. It is declared in
System.IO namespace and can also be found as a WindowsFroms component in the
VS toolbox.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top