我需要调用它:string input_ip_r = listView1.Items[lc].SubItems[1].Text;
所以我用过
if (InvokeRequired)
{
this.Invoke(new MethodInvoker(function));
return;
}
Run Code Online (Sandbox Code Playgroud)
这有效,但现在我把它放入BackgroundWorker并使用它
if (InvokeRequired)
{
this.Invoke(new MethodInvoker(bw.RunWorkerAsync));
return;
}
Run Code Online (Sandbox Code Playgroud)
它会给出一个错误,您一次只能运行BackgroundWorker一个错误.
那么我如何调用Backgroundworker?
我想运行这个:
string command = "echo test > test.txt";
System.Diagnostics.Process.Start("cmd.exe", command);
Run Code Online (Sandbox Code Playgroud)
它不起作用,我做错了什么?