Sample code as follows:
public class ThreadClass
{
private int nThreadID;
private TimeSpan tsRunning;
public int ID
{
get{ return nThreadID;}
}
public TimeSpan Duration
{
get{ return tsRunning;}
}
public ThreadClass( int ThreadID )
{
nThreadID = ThreadID;
}
public class xxx
{
......
private void button1_Click(object sender, System.EventArgs e)
{
a = new string[(int)nupUsers.Value];
b = new string[(int)nupUsers.Value];
try
{
for (int i = 0; i < 50; i++)
{
MyThread thread = new MyThread();
thread.i = i;
Thread t = new Thread(new ThreadStart(thread.ThreadProc));