我想從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