コード例 #1
0
        // only in .NET menu items get stripped...
        private void ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DomainWindow domainDialog = new DomainWindow(this.domain);

            domainDialog.ShowDialog(this);
            if (domainDialog.DialogResult == DialogResult.OK)
            {
                RegistryKey authKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\AuthorizerDomain");
                if (authKey != null)
                {
                    try
                    {
                        this.domain = (string)authKey.GetValue("domain");
                    }
                    catch (Exception ex)
                    {
                        return;
                    }
                    finally
                    {
                        authKey.Close();
                    }
                }
            }
        }
コード例 #2
0
 // only in .NET menu items get stripped...
 private void ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     DomainWindow domainDialog = new DomainWindow(this.domain);
     domainDialog.ShowDialog(this);
     if (domainDialog.DialogResult == DialogResult.OK)
     {
         RegistryKey authKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\AuthorizerDomain");
         if (authKey != null)
         {
             try
             {
                 this.domain = (string)authKey.GetValue("domain");
             }
             catch (Exception ex)
             {
                 return;
             }
             finally
             {
                 authKey.Close();
             }
         }
     }
 }