コード例 #1
0
        private void InstallButton_Click(object sender, EventArgs e)
        {
            ServiceLogonInformationDialog dlg = new ServiceLogonInformationDialog();

            switch (dlg.ShowDialog(this))
            {
            case DialogResult.Cancel:
                return;

            case DialogResult.OK:
                break;

            default:
                return;
            }

            try {
                using (ElevatedServiceClient c = new ElevatedServiceClient()) {
                    c.Interface.InstallService(dlg.User, dlg.Pass);
                }
            }
            catch (Exception ex) {
                MessageBox.Show(ex.Message);
                //throw;
                return;
            }

            setGuiElementsAccordingServiceState();
        }
コード例 #2
0
		private void InstallButton_Click(object sender, EventArgs e) {
            ServiceLogonInformationDialog dlg = new ServiceLogonInformationDialog();
            switch (dlg.ShowDialog(this)) {
                case DialogResult.Cancel:
                    return;
                case DialogResult.OK:
                    break;
                default:
                    return;
            } 

			try {
				using (ElevatedServiceClient c = new ElevatedServiceClient()) {
					c.Interface.InstallService(dlg.User, dlg.Pass);
				}
			}
			catch (Exception ex) {
				MessageBox.Show(ex.Message);
				//throw;
                return;
			}

			setGuiElementsAccordingServiceState();
		}