Hello Everyone,
I am currently using filesystemwatcher to transfer text files from my local machine onto a different server. The files loaded onto my local machine can be loaded at anytime of the day, and the problem is the server I am moving it to is known to go down several times.
Whenever a file is created on my local machine I want it to be copied directly to the server, and if the server is down, I want it to continually try every 5-10 minutes until successfull.
My code is the following for when a file is created
{
textBox1.Text += e.Name +
Delay(120000); // I can also use thread.sleep(120000) but this is just as inefficient.
}
public
ThisMoment =
Is there a way to put in a 2 minute delay without using the sleep method or making a while loop? I'm trying to make this as efficient as possible. I was told I could put my application to sleep and have the filesystemwatcher make a wakeup call everytime a new file is created. Is this possible? How would I do it?
Thank you all very much for any help you can provide.