Example #1
0
        private void BtnStart_Click(object sender, EventArgs e)
        {
            var msg = RuningWorker.Start();

            if (msg.Contains("正常启动成功"))
            {
                btnStart.Enabled = false;
                IsStart          = true;
            }
            MessageBox.Show(msg.Replace("<br/>", "\r\n"));
        }
Example #2
0
        private void BtnStop_Click(object sender, EventArgs e)
        {
            var msg = "程序并没启动";

            if (IsStart)
            {
                msg = RuningWorker.Stop();
                btnStart.Enabled = true;
                IsStart          = false;
            }
            MessageBox.Show(msg);
        }
Example #3
0
 protected override void OnStop()
 {
     RuningWorker.Stop();
 }
Example #4
0
 protected override void OnStart(string[] args)
 {
     RuningWorker.Start();
 }