摘要:
public static void DisplayDnsAddresses() { NetworkInterface[] adapters = NetworkInterface.GetAllNetworkInterfaces(); foreach (NetworkInterface adapter in adapters) { IPInterfaceProperties adapterProperties = adapter.GetIPProperties(); IPAddressCollection dnsServers = adapterProperties.DnsAddresses; 阅读全文
摘要:
本文使用二种方式来获取macaddress.1. 只能获取本机的.using System.Management;ManagementClass mc = new ManagementClass("Win32_NetworkAdapterConfiguration"); ManagementObjectCollection moc2 = mc.GetInstances(); foreach (ManagementObject mo in moc2) { if ((bool)mo["IPEnabled"] == true) this.textBox1.Te 阅读全文