using System;
using System.Threading;
namespace ParameterizedThreadStartTest
{
class Program
{
static void Main(string[] args)
{
ParameterizedThreadStart myParameterizedThreadDelegate = new ParameterizedThreadStart(ThreadMethod);
Thread myThread = new Thread(myParameterizedThreadDelegate);
object o = "hello";
myThread.Start(o);
}
private static void ThreadMethod(object o)
{
string str = o as string;
Console.WriteLine(str);
}
}
}
using System.Threading;
namespace ParameterizedThreadStartTest
{
class Program
{
static void Main(string[] args)
{
ParameterizedThreadStart myParameterizedThreadDelegate = new ParameterizedThreadStart(ThreadMethod);
Thread myThread = new Thread(myParameterizedThreadDelegate);
object o = "hello";
myThread.Start(o);
}
private static void ThreadMethod(object o)
{
string str = o as string;
Console.WriteLine(str);
}
}
}