The code in this snippet (and attached project zip) demonstrates how to use a background worker thread to monitor a network address (name or IP). It shows how to start and stop the thread and how to update controls in the main thread using delegates. It should be simple to use this code as a template for creating background threads for other tasks.
A couple of quick notes:
You may wonder why I have tab characters padding out my comments. It becomes more obvious when you set the comments to display with black foreground and light grey (or silver) background. When you do this it becomes a little prettier to look at. I prefer shaded comments because it more easily distinguishes code from comments, and makes it more obvious when code is commented out.
<edit>It looks like trailing blanks/tabs are automatically removed</edit>
The attached file is named as "yyyy-mm-dd hh-mm archive.zip". I don't use a CMS. When I get to a checkpoint I have a script that archives a folder. It prefixes the project folder name with the current date and time.
Edited 3 Years Ago by Reverend Jim