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"); } }
internal void addToQueries(DnsQueryResourceRecord record) { Queries.Add(record); listQueries.Items.Add(record.DomainName); }
public void DnsQueryResourceRecordDataGetTest() { var query = new DnsQueryResourceRecord(DnsDomainName.Root, DnsType.A, DnsClass.Internet); Assert.IsNull(query.Data); Assert.Fail(); }
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); }