123123123
本帖最后由 joseph 于 2017-3-13 15:10 编辑123123123123123 谢谢分享 Using System;
usingSystem.Threading;
public class SimpleThread
{
public void Method()
{
int i = 1,j = 2;
int result = i + j ;
Console.WriteLine("thread{0} Value{1}",
AppDomain.GetCurrentThreadId().ToString,
result.ToString());
}
static void Main()
{
SimpleThread thread1 = new SimpleThread();
thread1.Method();
ThreadStart ts = new ThreadStart(thread1.Method);
Thread t = new Thread(ts);
t.Start();
Console.ReadLine();
}
}Using System;
usingSystem.Threading;
public class SimpleThread
{
public void Method()
{
int i = 1,j = 2;
int result = i + j ;
Console.WriteLine("thread{0} Value{1}",
AppDomain.GetCurrentThreadId().ToString,
result.ToString());
}
static void Main()
{
SimpleThread thread1 = new SimpleThread();
thread1.Method();
ThreadStart ts = new ThreadStart(thread1.Method);
Thread t = new Thread(ts);
t.Start();
Console.ReadLine();
}
}Using System;
usingSystem.Threading;
public class SimpleThread
{
public void Method()
{
int i = 1,j = 2;
int result = i + j ;
Console.WriteLine("thread{0} Value{1}",
AppDomain.GetCurrentThreadId().ToString,
result.ToString());
}
static void Main()
{
SimpleThread thread1 = new SimpleThread();
thread1.Method();
ThreadStart ts = new ThreadStart(thread1.Method);
Thread t = new Thread(ts);
t.Start();
Console.ReadLine();
}
}