vb.net怎样获取网关和网关MAC
vb.net怎样获取网关和网关MAC --------------------编程问答-------------------- 添加对System.Management的引用using System.Management;
。。。
//获取IP,子网掩码(subnet mask)和默认网关
ManagementClass mc = new ManagementClass("Win32_NetworkAdapterConfiguration");
ManagementObjectCollection nics = mc.GetInstances();
foreach(ManagementObject nic in nics)
{
if(Convert.ToBoolean(nic["ipEnabled"]) == true)
{
Console.WriteLine((nic["IPAddress"] as String[])[0]);
Console.WriteLine((nic["IPSubnet"] as String[])[0]);
Console.WriteLine((nic["DefaultIPGateway"] as String[])[0]);
}
}
--------------------编程问答-------------------- 获取硬件信息源代码:
http://www.codeproject.com/cs/system/GetHardwareInformation/GetHardwareInfo_Code.zip
获取硬件信息演示程序:
http://www.codeproject.com/cs/system/GetHardwareInformation/GetHardwareInfo_Exe.zip
汉化
http://www.msproject.cn/Article/GetHardwareInformation.aspx
利用using System.Management类来获取相应的硬件知识
其实这类东西很容易找到答案的,方法非常多,最常见的API模式,你去搜索吧,保证一把一把的
==================================================================
博客空间:http://blog.csdn.net/lovingkiss
资源下载:http://download.csdn.net/user/lovingkiss
优惠接单开发,组件控件定制开发,成品源代码批发
联系方式:Q64180940 全天在线
================================================================== --------------------编程问答-------------------- jf up 学习 --------------------编程问答-------------------- 学习 --------------------编程问答-------------------- up --------------------编程问答-------------------- 学习学习。。。
补充:.NET技术 , VB.NET