i want to turn windows service on when it is off. is it possible to make via code from web application with c#? i am using asp.net mvc and c#.
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- MVC-Routing,Why i can not ignore defaults,The matc
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
Use the ServiceController class.
Its possible to do it but its unlikely that you want to run your website under an account which has enough rights to be able to Start/Stop services. You can use the ServiceController class to start a service see here
You're looking for the
ServiceController
class.Here an example: