473,412 Members | 2,051 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

Question About an Event Hook

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.

Jan 26 '06 #1
3 1545
Check out the FileSystemWatcher class in .Net.
--
Dale Preston
MCAD C#
MCSE, MCDBA
"ne***********@gmail.com" wrote:
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.

Jan 26 '06 #2
ne***********@gmail.com wrote:
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
Jan 26 '06 #3
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.

--
HTH
Stoitcho Goutsev (100)

<ne***********@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
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.

Jan 26 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Luke | last post by:
I am trying to capture an event when the screensaver starts. I have code working on Windows XP etc when the Password/Welcome Screen is enabled . Using the Fast User Switching Notifications. ...
5
by: Wayne Gibson | last post by:
Hi, Was wondering if somebody could help.. I'm trying to use Sendkeys on a Windows forms. I have entered the following command to simulate a CTRL+ALT+1.. ...
2
by: Marinos Christoforou | last post by:
Sorry if this has been asked before but as an inexperienced wanna-be C# programmer I wondering how to code classes to help build a standard Windows UI. For example to build a common toolbar. I...
5
by: Joe Thompson | last post by:
Hi, I am using VC++.Net 2003 with WinForms to write a serial port application. I downloaded the newest VC++ examples from MSDN and found a project called Using the COM Port. In it, there is a...
2
by: Boris Fortes | last post by:
I need to unhook event receiver as result of native C++ event. It unhooks successfully, but __raise does not return and throws access violation. Visual Studio 2003 How to reproduce: Consol...
15
by: Amit D.Shinde | last post by:
I am adding a new picturebox control at runtime on the form How can i create click event handler for this control Amit Shinde
8
by: pigeonrandle | last post by:
Hi, Has anyone had any experience with hooking messages in other application windows (like SPY++). I want to listen for WM_MOVE messages, but can only seem to find examples of Keyboard and Mouse...
3
by: The Saeed | last post by:
Hello, I try to use hook mouse event for a specific application (thread) in C#, I can use global hook, but i want to now which application sends mouse event, did you now what should I do? I set a...
1
by: Tom Rahav | last post by:
Hello, I try to develop application that runs in the background and suppose to display a small form with menu whenever the user clicks the middle mouse button (also when my application is not the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.