private void cmdOpenDlg1_Click(object sender, EventArgs e) { DialogURL dlg = new DialogURL(); dlg.ShowDialog(this); using (ServiceController sc = new ServiceController("JidouJunkaiService")) { sc.Refresh(); if (sc.Status == ServiceControllerStatus.Running) { sc.Stop(); } if (sc.Status == ServiceControllerStatus.Stopped) { sc.Start(); } Redisplay(); } }
private void cmdOpenDlg1_Click(object sender, EventArgs e) { DialogURL dlg = new DialogURL(); dlg.ShowDialog(); }