J
Jeremy S.
I have created a small console app that creates a few custom objects - each
of which makes use of the System.IO.FileSystemWatcher class. Each object is
responsible for monitoring a different folder on the local machine.
Here is the P-Code for the current console app version
static void Main() {
// 1 - Read the app's config file to determine which folders to watch
// 2 - Instantiate instances of my custom watcher class - one instance per
folder watched (and set various properties of each object) - then add each
instance to a HybridDictionary.
// 3 - KEEP THIS APP RUNNING until I explicitly end it
Console.WriteLine("Press \'q\' to quit the sample.");
while(Console.Read()!='q');
} // END OF P-CODE
What do I do about step 3 when converting this console app to a Windows
Service? How do I ensure that the program will run until I explicitly shut
it down (i.e., I don't want it to execute from top to bottom and then exit
immediately - as the console app would do without the two lines listed above
in step 3).
Thanks!
of which makes use of the System.IO.FileSystemWatcher class. Each object is
responsible for monitoring a different folder on the local machine.
Here is the P-Code for the current console app version
static void Main() {
// 1 - Read the app's config file to determine which folders to watch
// 2 - Instantiate instances of my custom watcher class - one instance per
folder watched (and set various properties of each object) - then add each
instance to a HybridDictionary.
// 3 - KEEP THIS APP RUNNING until I explicitly end it
Console.WriteLine("Press \'q\' to quit the sample.");
while(Console.Read()!='q');
} // END OF P-CODE
What do I do about step 3 when converting this console app to a Windows
Service? How do I ensure that the program will run until I explicitly shut
it down (i.e., I don't want it to execute from top to bottom and then exit
immediately - as the console app would do without the two lines listed above
in step 3).
Thanks!