System.Diagnostics.Process.Start("IISRESET.exe");
Run Code Online (Sandbox Code Playgroud)
注意:您需要提供正确的路径IISRESET作为参数.以上只是示例代码.
System.Diagnostics.Process process = new System.Diagnostics.Process();
//process.StartInfo.FileName = @"C:\WINDOWS\system32\iisreset.exe";
process.StartInfo.FileName = "cmd";
process.StartInfo.Arguments = "/C iisreset /STOP";
process.StartInfo.UseShellExecute = false;
process.StartInfo.CreateNoWindow = true;
process.StartInfo.RedirectStandardError = true;
process.StartInfo.RedirectStandardOutput = true;
process.Start();
process.WaitForExit();
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4109 次 |
| 最近记录: |