this.serviceController1 = new ServiceController();
this.serviceController1.ServiceName = "MSFtpsvc";
if (this.serviceController1.Status == ServiceControllerStatus.Paused)
{
try
{
this.serviceController1.Continue();
this.serviceController1.WaitForStatus(ServiceControllerStatus.Running);
MessageBox.Show("已经继续Internet信息服务默认FTP站点。", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
转载于:https://www.cnblogs.com/greencolor/archive/2010/07/29/1787891.html