日期:2014-05-16 浏览次数:20780 次
protected void btnAppStart_Click(object sender, EventArgs e) { ServiceController SVS = new ServiceController(); SVS.ServiceName = "SubSystemControl"; if (SVS.Status == ServiceControllerStatus.Stopped) { string[] args=new string[2]; args[0] = txt_AppAddress.Value ; args[1] = ""; SVS.Start(args); } if (SVS.Status == ServiceControllerStatus.Running) { SVS.Stop(); } } protected void btnAppEnd_Click(object sender, EventArgs e) { ServiceController SVS = new ServiceController(); SVS.ServiceName = "SubSystemControl"; if (SVS.Status == ServiceControllerStatus.Running) { string[] args = new string[2]; args[0] = txt_AppAddress.Value; args[1] = ""; SVS.Stop(); } }