示例#1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            try
            {
                DnsQueryResourceRecord record = new DnsQueryResourceRecord(
                    new DnsDomainName(txtDomainName.Text),
                    (DnsType)Enum.Parse(typeof(DnsType), cmbType.SelectedItem.ToString()),
                    (DnsClass)Enum.Parse(typeof(DnsClass), cmbClass.SelectedItem.ToString()));

                tabDNS.addToQueries(record);
                this.Close();
            }
            catch (Exception)
            {
                MessageBox.Show("Invalid Parameters");
            }
        }
示例#2
0
 internal void addToQueries(DnsQueryResourceRecord record)
 {
     Queries.Add(record);
     listQueries.Items.Add(record.DomainName);
 }
示例#3
0
 public void DnsQueryResourceRecordDataGetTest()
 {
     var query = new DnsQueryResourceRecord(DnsDomainName.Root, DnsType.A, DnsClass.Internet);
     Assert.IsNull(query.Data);
     Assert.Fail();
 }
示例#4
0
 public static DnsQueryResourceRecord NextDnsQueryResourceRecord(this Random random)
 {
     DnsQueryResourceRecord record = new DnsQueryResourceRecord(random.NextDnsDomainName(), random.NextEnum<DnsType>(), random.NextEnum<DnsClass>());
     return record;
 }
        public static DnsQueryResourceRecord NextDnsQueryResourceRecord(this Random random)
        {
            DnsQueryResourceRecord record = new DnsQueryResourceRecord(random.NextDnsDomainName(), random.NextEnum <DnsType>(), random.NextEnum <DnsClass>());

            return(record);
        }