当前位置: 代码迷 >> ASP.NET >> 怎么在web程序里控制windows service
  详细解决方案

怎么在web程序里控制windows service

热度:1139   发布时间:2013-02-26 00:00:00.0
如何在web程序里控制windows service
想在web端程序控制某个service的启动   停止,怎么做?

------解决方案--------------------------------------------------------
try this :

Process p = new Process();
p.StartInfo.FileName = "cmd.exe ";
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.CreateNoWindow = false;
string[] strOutput = new string[2];
p.Start();
p.StandardInput.WriteLine( "net start yourService ");

------解决方案--------------------------------------------------------
提升你IIS的权限
------解决方案--------------------------------------------------------
权限问题
  相关解决方案