using System.ServiceProcess;
ServiceController controller = new ServiceController();
controller.MachineName = ".";
controller.ServiceName = "MSSQL$SQLEXPRESS";
controller.Stop();
controller.WaitForStatus(ServiceControllerStatus.Stopped);
controller.Start();
controller.WaitForStatus(ServiceControllerStatus.Running);
最近のコメント