Guest learn Posted September 2, 2002 Posted September 2, 2002 Hi, Can you show me a very very simple example using Multi-thread? Thank you in advance. Quote
*Gurus* Derek Stone Posted September 2, 2002 *Gurus* Posted September 2, 2002 Straight from the .NET SDK: Imports System Imports System.Threading Public Class ThreadWork Public Shared Sub DoWork() Dim i As Integer For i = 0 To 2 Console.WriteLine("Working thread...") Thread.Sleep(100) Next i End Sub 'DoWork End Class 'ThreadWork Class ThreadTest Public Shared Sub Main() Dim myThreadDelegate As New ThreadStart(AddressOf ThreadWork.DoWork) Dim myThread As New Thread(myThreadDelegate) myThread.Start() Dim i As Integer For i = 0 To 2 Console.WriteLine("In main.") Thread.Sleep(100) Next i End Sub 'Main End Class 'ThreadTest Quote Posting Guidelines
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.