home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2005 June (DVD) / DPPRO0605DVD.iso / dotNETSDK / SETUP.EXE / netfxsd1.cab / FL_Timed_vb________.3643236F_FC70_11D3_A536_0090278A1BB8 < prev    next >
Encoding:
Text File  |  2001-08-21  |  681 b   |  22 lines

  1. Imports System
  2. Imports System.Threading
  3.  
  4.  
  5. Class App
  6.    Shared Sub Main()
  7.       Console.WriteLine("Checking for status updates every 2 seconds.")
  8.       Console.WriteLine("   (Hit Enter to terminate the sample)")
  9.       Dim timer As New Timer(new TimerCallback(AddressOf CheckStatus), nothing, 0, 2000)
  10.  
  11.       Console.Write("Press Enter to close window...")
  12.       Console.Read()
  13.    End Sub
  14.  
  15.  
  16.    ' The callback method's signature MUST match that of a System.Threading.TimerCallback 
  17.    ' delegate (it takes an Object parameter and returns void)
  18.    Shared Sub CheckStatus(state As Object)
  19.       Console.WriteLine("Checking Status.")
  20.       ' ...
  21.    End Sub
  22. End Class