本文介绍了如何从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服务器
发布评论