January 2008
Beginner
352 pages
9h 6m
English
This chapter requires us to extend the capabilities of the current thread function. In the next section, we will extend the usage of the threads.
Modify your existing ThreadFunc to match the code shown in Example 4-8.
Example 4-8. Updates to the current thread method.
Private Sub ThreadFunc() While Not m_ThreadAction.StopThread If Not m_ThreadAction.Pause Then Try For Each TextFile As String In My.Computer.FileSystem.GetFiles( _ My.Resources.IncomingPath, _ FileIO.SearchOption.SearchTopLevelOnly, "*.txt") If m_ThreadAction.Pause Or m_ThreadAction.StopThread Then Exit For End If Try WriteLogEvent(My.Resources.ThreadMessage + TextFile, _ THREAD_INFO, EventLogEntryType.Information, My.Resources.Source) Catch ex As Exception ...
Read now
Unlock full access