private void btnStopService_Click(object sender, EventArgs e) { MainThreadContext.Main.StopService(); //停止 WCF 服務 WcfHostService.StopWcfHost(); btnStartService.Enabled = true; timerJobUpdate.Enabled = (sender as Button).Enabled = false; }
protected override void OnStop() { MainThreadContext.Main.StopService(); //停止 WCF 服務 WcfHostService.StopWcfHost(); }