如何建立使用带参数的新线程?
public void Main()
{
Thread newThread = new Thread(new ThreadStart(this.Work));
newThread.Start();
}
public void Work()
{
}
public void SetDataSet(DataSet dataset)
{}
--------------------------------------------------
如何对SetDataSet起一个新的线程呢?
------解决方案--------------------public void Main()
{
Thread newThread = new Thread(new ThreadStart(this.Work));
newThread.Start();
Thread newThread1 = new Thread(new ThreadStart(this.SetDataSet));
newThread.Start();
}
// 重载一个参数的,以便启动线程。
public void SetDataSet()
{
SetDataSet(DataSetValue);
}
public void SetDataSet(DataSet dataset)
{
// do something.
}