Adding New Polling Code
The next step is to create the code that will look for these files and then add an event into the Application log. To do this we must modify the current <ThreadFunc> method. Before we modify <ThreadFunc>, we need to add another import statement to the top of tutorials.vb that will be used interact with the file system. Although the import is not required, it makes it easier to create class instances of the IO namespace without having to declare the entire namespace for each variable declared.
Add the code shown in Example 4-3 to the top of the Tutorials.vb file.
Example 4-3. Add a new Imports statement.
Imports System.IO
We can now directly access the file system classes used to check for any text files, without using the entire ...
Get Programming Windows® Services with Microsoft® Visual Basic® 2008 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.