日期:2014-05-19  浏览次数:20422 次

如何在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的权限
------解决方案--------------------
权限问题