Remote server services Starting using C#

Posted by Karthikanbarasan under C# category on | Points: 40 | Views : 3796
using System.Diagnostics;
using System.Threading;

Service controller should be used along with the thread in order to refresh or start the process with a bit time in order to avoid overlapping

System.ServiceProcess.ServiceController svcobj = new System.ServiceProcess.ServiceController(ServiceName, ServerIP);
if (svc.Status.Equals(System.ServiceProcess.ServiceControllerStatus.Running))
svcobj .Start();

Comments or Responses

Login to post response