一段获得网卡地址的代码,可以用来做软件许可证用.
2005-11-27 17:02:33 来源:WEB开发网核心提示:ManagementClass mcMAC = new ManagementClass("Win32_NetworkAdapterConfiguration");ManagementObjectCollection mocMAC = mcMAC.GetInstances();foreach(Mana
ManagementClass mcMAC = new ManagementClass("Win32_NetworkAdapterConfiguration");
ManagementObjectCollection mocMAC = mcMAC.GetInstances();
foreach(ManagementObject m in mocMAC)
{
if((bool)m["ipEnabled"])
{
return m["MacAddress"].ToString();
}
}
ManagementObjectCollection mocMAC = mcMAC.GetInstances();
foreach(ManagementObject m in mocMAC)
{
if((bool)m["ipEnabled"])
{
return m["MacAddress"].ToString();
}
}
更多精彩
赞助商链接