我将在asp.net中获得DNS服务器情况(升级或停机),我可以获得服务器的IP地址,但我无法实现DNS服务器的情况!
这是我获取IP地址的代码。
NetworkInterface[] adapters = NetworkInterface.GetAllNetworkInterfaces();
foreach (NetworkInterface adapter in adapters)
{
IPInterfaceProperties adapterProperties = adapter.GetIPProperties();
IPAddressCollection dnsServers = adapterProperties.DnsAddresses;
if (dnsServers.Count > 0)
{
txtAdapterdescription.Text += adapter.Description;
foreach (IPAddress dns in dnsServers)
{
txtDNSserverbox.Text += dns.ToString();
}
}
}
任何人都可以帮我实现DNS服务器的情况吗?
由于