.net 为什么对IPInterfaceProperties::DnsAddresses的调用会返回三个DNS服务器?
我在Windows XP嵌入式计算机上运行了一些代码,这些代码试图使用以下代码段记录当前的网络设置:.net 为什么对IPInterfaceProperties::DnsAddresses的调用会返回三个DNS服务器?,.net,networking,c++-cli,windows-xp-embedded,.net,Networking,C++ Cli,Windows Xp Embedded,我在Windows XP嵌入式计算机上运行了一些代码,这些代码试图使用以下代码段记录当前的网络设置: array<NetworkInterface^>^ ifs = NetworkInterface::GetAllNetworkInterfaces(); for each (NetworkInterface^ nic in ifs) { IPInterfaceProperties^ properties = nic->GetIPProperties(); for
array<NetworkInterface^>^ ifs = NetworkInterface::GetAllNetworkInterfaces();
for each (NetworkInterface^ nic in ifs)
{
IPInterfaceProperties^ properties = nic->GetIPProperties();
for each( IPAddress^ ipaddress in properties->DnsAddresses)
{
Console::WriteLine(String::Format("{0}", ipaddress));
}
}
第一行是从哪里来的。。如果我在Windows 7计算机上运行相同的代码,为什么不显示?看起来像是默认的IPv6 DNS地址。我不知道为什么它不会出现在Windows 7中,但我想这取决于您的DNS设置。奇怪的是,即使禁用了DNS,我仍然可以看到该条目。更令人费解的是,Windows XP Embedded似乎不支持IPv6(?)。或者至少在适配器属性中没有任何可配置的选项。
fec0:0:0:ffff::1%1
8.8.8.8
8.8.4.4