How to start windows service

string ServiceName="Put you Service Name";
ServiceController sc = new ServiceController(ServiceName);
if (sc != null && sc.Status == ServiceControllerStatus.Stopped)
{ sc.Start();
sc.WaitForStatus(ServiceControllerStatus.Running);
}

Posted By
Akash Sarin
softwareakash@gmail.com

0 comments: