Ejemplo n.º 1
0
        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;
            }
        }
Ejemplo n.º 2
0
 private void cmdRestartAsAdmin_Click(object sender, EventArgs e)
 {
     Tricks.RestartAsAdmin();
 }