private void btnDuplicate_Click(object sender, EventArgs e)
 {
     try
     {
         OpenForm(this, _token.DuplicateToken((TokenType)comboBoxTokenType.SelectedItem,
                                              (TokenLibrary.TokenImpersonationLevel)comboBoxImpLevel.SelectedItem,
                                              (TokenLibrary.TokenIntegrityLevel)comboBoxILForDup.SelectedItem), false);
     }
     catch (Exception ex)
     {
         MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Пример #2
0
 private void btnDuplicate_Click(object sender, EventArgs e)
 {
     try
     {
         using (UserToken token = _token.DuplicateToken((TokenType)comboBoxTokenType.SelectedItem,
                                                        (TokenLibrary.TokenImpersonationLevel)comboBoxImpLevel.SelectedItem,
                                                        (TokenLibrary.TokenIntegrityLevel)comboBoxILForDup.SelectedItem))
         {
             if (checkBoxLuaToken.Checked)
             {
                 OpenForm(this, token.MakeLuaToken(), false);
             }
             else
             {
                 OpenForm(this, token, true);
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }