如何在调用一个可执行文件同时传入参数?
我想调用一个杀毒软件对一个文件杀毒,一般是:杀毒软件 文件 参数
的格式。假定txtKiller重视杀毒软件的文件,txtFile是要检查的文件
Process p=new Process();
p.StartInfo.FileName="cmd";
p.StartInfo.UseShellExecute=false; p.StartInfo.RedirectStandardInput=true; p.StartInfo.RedirectStandardOutput=true; p.StartInfo.RedirectStandardError=true;
p.StartInfo.CreateNoWindow=true;
string input=this.txtKiller.Text+" "+this.txtFile.Text+" %f";
p.Start();
p.StandardInput.WriteLine(input);
但是结果没有反应,任务管理起重没有相关的杀毒软件进程。
这是为什么呢?