摘要: public static void DisplayDnsAddresses() { NetworkInterface[] adapters = NetworkInterface.GetAllNetworkInterfaces(); foreach (NetworkInterface adapter in adapters) { IPInterfaceProperties adapterProperties = adapter.GetIPProperties(); IPAddressCollection dnsServers = adapterProperties.DnsAddresses; 阅读全文
posted @ 2008-02-22 11:15 greystar 阅读(247) 评论(0) 推荐(0) 编辑
摘要: 本文使用二种方式来获取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 阅读全文
posted @ 2008-02-22 09:21 greystar 阅读(3783) 评论(0) 推荐(0) 编辑