protected override void OnStart(string[] args) { string targetDir = string.Format(args[0]); proc = new Process(); proc.StartInfo.WorkingDirectory = targetDir; proc.StartInfo.FileName = args[1]; proc.Start(); } protected override void OnStop() { proc.Kill(); }
ServiceController service = new ServiceController("ServiceName"); service.Stop(); service.WaitForStatus(ServiceControllerStatus.Stopped);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)