終身高級VIP會員
- 資源幣
- 435
- 積分
- 833
- 貢獻
- 0
- 在線時間
- 60 小時
- 注冊時間
- 2016-2-27
- 最后登錄
- 2024-11-11
|
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();
}
} |
|