我的机器上安装了一个VirtualBoxVM,因此有一个以太网适配器出现在我的机器上。我正在通过以下方式枚举我机器的IP地址列表:publicstringGetLocalIpAddress(){try{stringstrHostName=Dns.GetHostName();//Thenusinghostname,gettheIPaddresslist..IPHostEntryipEntry=Dns.GetHostEntry(strHostName);foreach(IPAddressipinipEntry.AddressList){if(ip.AddressFamily==System
我需要知道如何使用他们的IPv4获取所有网络接口(interface)地址。或者只是无线和以太网。要获取所有网络接口(interface)的详细信息,我使用这个:foreach(NetworkInterfaceniinNetworkInterface.GetAllNetworkInterfaces()){if(ni.NetworkInterfaceType==NetworkInterfaceType.Wireless80211||ni.NetworkInterfaceType==NetworkInterfaceType.Ethernet){Console.WriteLine(ni.Na
我需要知道如何使用他们的IPv4获取所有网络接口(interface)地址。或者只是无线和以太网。要获取所有网络接口(interface)的详细信息,我使用这个:foreach(NetworkInterfaceniinNetworkInterface.GetAllNetworkInterfaces()){if(ni.NetworkInterfaceType==NetworkInterfaceType.Wireless80211||ni.NetworkInterfaceType==NetworkInterfaceType.Ethernet){Console.WriteLine(ni.Na