过于一个线程的问题,请教一下,谢谢
using System;using System.Threading;
namespace Temp2
{
class Class1
{
static void Founction1()
{
for (int i=0;i<10;i++)
Console.WriteLine("Work in Founction1.");
}
static void Founction2()
{
for (int i=0;i<10;i++)
Console.WriteLine("Work in Founction2.");
}
[STAThread]
static void Main(string[] args)
{
ThreadStart ts1=new ThreadStart(Founction1);
ThreadStart ts2=new ThreadStart(Founction2);
Thread t1=new Thread(ts1);
Thread t2=new Thread(ts2); t1.Priority=System.Threading.ThreadPriority.AboveNormal;
t1.Priority=System.Threading.ThreadPriority.Lowest; t1.Start();
t2.Start();
}
}
}
这个程序运行没有问题,但是如果函数:
static void Founction1(int n1);
static void Founction2(int n2);
执行线程如何把参数传递到函数里面?需要用委托,但是我不会用,怎么作?帮助一下,谢谢。