我想从c#
代码运行一些cmd
命令。我跟着一些博客和教程,得到了答案,但我有点混乱,即如何传递多个参数?如何在processStartInfo中传递多个参数?
我使用如下代码:
System.Diagnostics.Process process = new System.Diagnostics.Process();
System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal;
startInfo.FileName = "cmd.exe";
startInfo.Arguments =
...
什么将是下面的命令行代码startInfo.Arguments
价值?
makecert -sk server -sky exchange -pe -n CN=localhost -ir LocalMachine -is Root -ic MyCA.cer -sr LocalMachine -ss My MyAdHocTestCert.cer
netsh http add sslcert ipport=127.0.0.1:8085 certhash=0000000000003ed9cd0c315bbb6dc1c08da5e6 appid={00112233-4455-6677-8899-AABBCCDDEEFF} clientcertnegotiation=enable
如果我需要使用|像这个命令中的符号? netstat -ano | find/i“聆听”| find/i“17328” – Revious 2015-03-06 13:14:20
我的猜测是要逃避“通过使用”,给它一个镜头。 – 2015-03-09 13:18:47
也许我不明白这个答案,但是你的代码似乎只添加一条指令,这是OP提到的第一条指令。他们怎么可能用相同的startInfo添加他们的第二条指令? – ThePartyTurtle 2016-07-01 15:03:10