1、在类中定义方法Process(),和属性
public class ProcessClass
{
public int start
{
get;
set;
}
public int end{
get;
set;
}
public void Process()
{
for(int i=start;i<end;i++){
}
}
}
2.在线程里调用方法和属性
int start=0;
int end=10;
ProcessClass A= new ProcessClass();
Thread thread = new Thread(new ThreadStart(A.Process));
A.start = start;
A.end = end;
thread.Start();