如和用反射调用类的一个方法的同时建立线程,让这个方法在新线程里运行?
如:
t是一个type类;
object ob=Activator.CreateInstance(t,param);
t.InvokeMember(mothodname,BindingFlags.InvokeMethod,null,ob,args)
如何让调用的方法在新线程里运行
如:
t是一个type类;
object ob=Activator.CreateInstance(t,param);
t.InvokeMember(mothodname,BindingFlags.InvokeMethod,null,ob,args)
如何让调用的方法在新线程里运行
{
System.Threading.Thread t = new System.Threading.Thread(new System.Threading.ThreadStart());
t.Start();
}
public void StartThread()
{
object ob=Activator.CreateInstance(t,param);
t.InvokeMember(mothodname,BindingFlags.InvokeMethod,null,ob,args);}