I got below function from http://techinterviewquestion.blogspot.com/
blog. it is working fine. i used
public void StartService(st ring ServiceName)
{
ServiceControll er sc = new ServiceControll er(ServiceName) ;
if (sc != null && sc.Status == ServiceControll erStatus.Stoppe d)
{
sc.Start();
sc.WaitForStatu s(ServiceContro llerStatus.Runn ing);
}
}
blog. it is working fine. i used
public void StartService(st ring ServiceName)
{
ServiceControll er sc = new ServiceControll er(ServiceName) ;
if (sc != null && sc.Status == ServiceControll erStatus.Stoppe d)
{
sc.Start();
sc.WaitForStatu s(ServiceContro llerStatus.Runn ing);
}
}
Comment