终身高级VIP会员
- 资源币
- 435
- 积分
- 833
- 贡献
- 0
- 在线时间
- 60 小时
- 注册时间
- 2016-2-27
- 最后登录
- 2024-11-11
|
发表于 2017-3-28 23:42:34
|
显示全部楼层
Using System;
using System.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;
using System.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;
using System.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();
}
} |
|