如何从aspx页面重新启动Web服务器 [英] how to restart web server from aspx page
本文介绍了如何从aspx页面重新启动Web服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要重启我的网络服务器,因为它有时会被绞死。但我能够访问我的网站。所以我想建立一个网页,通过它我可以给服务器命令重启。
I need to reboot my web server,because it gets hanged sometimes.But i am able to access my web site.So i want to make a web page,by which i can give command of reboot to server.
推荐答案
Process p = new Process();
p.StartInfo = new ProcessStartInfo("cmd.exe");
p.StartInfo.Arguments =@"shutdown /m \\ComputerName /r /t:01 /y /f";
p.StartInfo.WorkingDirectory = workingDirectory;
//p.StartInfo.CreateNoWindow = true;
p.StartInfo.ErrorDialog = true;
//p.StartInfo.RedirectStandardInput = true;
p.StartInfo.UseShellExecute = false;
p.Start();
p.WaitForExit();
p.Close()
这篇关于如何从aspx页面重新启动Web服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文