如何在asp.net代码中安装和运行Windows服务? [英] How to install and run a windows service in asp.net code behind?
问题描述
如何在asp.net中安装和运行Windows服务?
我运行已安装的服务为
ServiceController service = new ServiceController(C3PSPS_Service);
TimeSpan超时= TimeSpan.FromMilliseconds(timeoutMilliseconds);
service.Start();
service.WaitForStatus (ServiceControllerStatus.Running,超时);
并且它有效。
现在我想在asp.net代码中安装它并运行同样。
How to install and run a windows service in asp.net ?
I ran the installed service as
ServiceController service = new ServiceController("C3PSPS_Service");
TimeSpan timeout = TimeSpan.FromMilliseconds(timeoutMilliseconds);
service.Start();
service.WaitForStatus(ServiceControllerStatus.Running, timeout);
and it worked.
Now i want to install it in asp.net code behind and run the same.
推荐答案
参考
http://www.thedavejay.com/2012/04/self-installing-c-windows-service-safe.html [ ^ ]
http://stackoverflow.com/questions/4144019/self-install-windows-service-in-net-c-sharp [ ^ ]
http://stackoverflow.com/questions/358700/how-to-install-a-windows-service-programmatically-in-c [ ^ ]
希望这有助于
Refer
http://www.thedavejay.com/2012/04/self-installing-c-windows-service-safe.html[^]
http://stackoverflow.com/questions/4144019/self-install-windows-service-in-net-c-sharp[^]
http://stackoverflow.com/questions/358700/how-to-install-a-windows-service-programmatically-in-c[^]
Hope this helps
这篇关于如何在asp.net代码中安装和运行Windows服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!