private void MainDLG_Load(object sender, EventArgs e) { chkUseOnPrem.Checked = RegistryData.UseOnPremServer; txtOnPrem.Text = RegistryData.ServerURL; txtContractID.Text = RegistryData.ContractID; txtPassword.Text = RegistryData.ContractPassword; lblStatus.Text = ""; chkUseOnPrem_CheckedChanged(null, null); if (Tricks.IsAdmin() == false) { Tricks.UACToButton(cmdRestartAsAdmin, true); txtContractID.Enabled = txtOnPrem.Enabled = txtPassword.Enabled = false; chkUseOnPrem.Enabled = false; cmdOK.Enabled = false; } else { cmdRestartAsAdmin.Visible = cmdRestartAsAdmin.Enabled = false; } }
private void cmdRestartAsAdmin_Click(object sender, EventArgs e) { Tricks.RestartAsAdmin(); }