O'Reilly logo

Programming Windows® Services with Microsoft® Visual Basic® 2008 by Michael Gernaey

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Implementing a Solution

For our solution we will offer a staggered approach. First we will separate the incoming processing of files—which entails moving them to the outgoing path—from the processing of the files, the e-mail being sent, and the actual movement into the Processed folder.

Creating a New <FileWorker.ProcessingIncoming> Method

Creating a new <FileWorker.ProcessingIncome> method is fairly straightforward. In this case we take the FileWorker class and implement the code shown in Example 5-10 by replacing the FileWorker class <ThreadFunc> method.

Example 5-10. The new <ProcessIncoming> thread method.

Private Sub ProcessIncoming() While Not m_ThreadAction.StopThread If Not m_ThreadAction.Pause Then Try For Each TextFile As String In My.Computer.FileSystem.GetFiles( ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required