ServiceControllerInfo
-
si = new ServiceControllerInfo(new ServiceController("myservice")); si.Controller.Start();/\*this line throw me an exception telling that :Cannot open myservice service on computer '.'. i have tried alot but it wont solve! \*/ si.Controller.WaitForStatus(ServiceControllerStatus.Running);
-
si = new ServiceControllerInfo(new ServiceController("myservice")); si.Controller.Start();/\*this line throw me an exception telling that :Cannot open myservice service on computer '.'. i have tried alot but it wont solve! \*/ si.Controller.WaitForStatus(ServiceControllerStatus.Running);
Hi, there could be many reasons why starting a service fails, e.g. your code is in an aspx page; or you don't have the necessary privileges (are you running as admin? is this Vista?); does the service exist, and is its status "Stopped"? etc. :)
Luc Pattyn [Forum Guidelines] [My Articles]
I use ListBoxes for line-oriented text output (not TextBoxes), and PictureBoxes for pictures (not drawings).
modified on Friday, June 10, 2011 12:22 PM
-
Hi, there could be many reasons why starting a service fails, e.g. your code is in an aspx page; or you don't have the necessary privileges (are you running as admin? is this Vista?); does the service exist, and is its status "Stopped"? etc. :)
Luc Pattyn [Forum Guidelines] [My Articles]
I use ListBoxes for line-oriented text output (not TextBoxes), and PictureBoxes for pictures (not drawings).
modified on Friday, June 10, 2011 12:22 PM