V
VM
I'm trying to add multithreading to my win application but I'm having
trouble with the code since the method to be threaded has parameters. How
can I add multithreading to a method with parameters? MSDN says ThreadStart
cannot take parameters, so how can I do it?
public System.Threading.Thread Thread_LoadAZM;
public void LoadFile(string sFileName)
{
Thread_LoadAZM=System.Threading.Thread(new
System.Threading.ThreadStart(this.loadAuditFile)); //error
Thread_LoadAZM.Start();
}
private void loadAuditFile(string sFileName)
{
.....
}
Thanks again for your help.
trouble with the code since the method to be threaded has parameters. How
can I add multithreading to a method with parameters? MSDN says ThreadStart
cannot take parameters, so how can I do it?
public System.Threading.Thread Thread_LoadAZM;
public void LoadFile(string sFileName)
{
Thread_LoadAZM=System.Threading.Thread(new
System.Threading.ThreadStart(this.loadAuditFile)); //error
Thread_LoadAZM.Start();
}
private void loadAuditFile(string sFileName)
{
.....
}
Thanks again for your help.