Пример #1
0
        private void btnLookUp_Click(object sender, EventArgs e)
        {
            //Lookup Resource Record,
            //Enter App in Wait State
            //Print Result, Exit
            if (txtHost.Text == null || txtHost.Text.Length == 0)
            {
                MessageBox.Show("Enter valid Host!");
                txtHost.Focus();
                return;
            }

            Application.DoEvents();
            sbrResult.Text = "Please wait...";
            this.Enabled = false;
            Application.DoEvents();
            

            DnsQuery query = new DnsQuery();

            query.Domain = txtHost.Text;
            query.DnsServer = new System.Net.IPEndPoint(System.Net.IPAddress.Parse(txtDNS.Text.Trim()), 53);
            try
            {
                DnsAnswer answer = query.QueryServer(ParseEnumFromCombo());
                if (answer != null)
                {
                    DNS.frmDNSResult result = new ActiveUp.Net.Samples.CompactPPC.DNS.frmDNSResult();
                    result.Output = answer;
                    result.ShowDialog();
                    result.Dispose();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            
            sbrResult.Text = "Ready";
            this.Enabled = true;
            EnableControls();
            Application.DoEvents();
        }
Пример #2
0
        private void btnLookUp_Click(object sender, EventArgs e)
        {
            //Lookup Resource Record,
            //Enter App in Wait State
            //Print Result, Exit
            if (txtHost.Text == null || txtHost.Text.Length == 0)
            {
                MessageBox.Show("Enter valid Host!");
                txtHost.Focus();
                return;
            }

            Application.DoEvents();
            sbrResult.Text = "Please wait...";
            this.Enabled   = false;
            Application.DoEvents();


            DnsQuery query = new DnsQuery();

            query.Domain    = txtHost.Text;
            query.DnsServer = new System.Net.IPEndPoint(System.Net.IPAddress.Parse(txtDNS.Text.Trim()), 53);
            try
            {
                DnsAnswer answer = query.QueryServer(ParseEnumFromCombo());
                if (answer != null)
                {
                    DNS.frmDNSResult result = new ActiveUp.Net.Samples.CompactPPC.DNS.frmDNSResult();
                    result.Output = answer;
                    result.ShowDialog();
                    result.Dispose();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }

            sbrResult.Text = "Ready";
            this.Enabled   = true;
            EnableControls();
            Application.DoEvents();
        }