STOP FTP

  this.serviceController1 = new ServiceController();
            this.serviceController1.ServiceName = "MSFtpsvc";           
            if (this.serviceController1.Status == ServiceControllerStatus.Running)
            {
                try
                {
                    this.serviceController1.Stop();
                    this.serviceController1.WaitForStatus(ServiceControllerStatus.Stopped);
                    MessageBox.Show("已经停止Internet信息服务默认FTP站点。", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }

posted @ 2010-07-29 14:45  greencolor  阅读(118)  评论(0编辑  收藏  举报