home *** CD-ROM | disk | FTP | other *** search
- using System;
- using System.Threading;
-
- public class Alpha
- {
-
- // The method that will be called when the thread is started
- public void Beta()
- {
- Console.WriteLine("Alpha.Beta is running in its own thread.");
- }
- };
-
- public class Simple
- {
- public static int Main(String[] args)
- {
- Console.WriteLine("Thread Simple Sample");
- Alpha oAlpha = new Alpha();
-
- // Create the thread object, passing in the Alpha.Beta method
- // via a ThreadStart delegate
- Thread oThread = new Thread(new ThreadStart(oAlpha.Beta));
-
- // Start the thread
- oThread.Start();
-
- return 0;
- }
- }