I wrote a service that should start / stop other services. This is the code I'm using:
ServiceController sc = new ServiceController("servicename");
if(sc.Status != ServiceControllerStatus.Running)
{
sc.Start();
}
This is an exception column. (Sorry, but the message is localized in German, but this does not apply to understanding my problem)
System.InvalidOperationException: Der Dienst SCardSvr kann nicht auf dem
A computer. geöffnet werden. ---> System.ComponentModel.Win32Exception: Zugriff verweigert
--- Ende der internen Ausnahmestapelüberwachung ---
bei System.ServiceProcess.ServiceController.GetServiceHandle (Int32 DesiredAccess)
bei System.ServiceProcess.ServiceController.Start (String [] args)
bei System .ServiceProcess.ServiceController.Start ()
"Networkervice". , .
, / .
?