有人知道如何从 c# 应用程序运行“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();
关于C# 运行应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4710696/