GUID是由VS2008/2005自动生成!
以下函数获取MAC地址(我平时自己用的):
需要using System.Management;
///
/// Get LocalHost MAC Address
///
///
public string GetHostMacAddress()
{
ManagementClass mc;
string mac = string.Empty;
mc = new ManagementClass("Win32_NetworkAdapterConfiguration");
ManagementObjectCollection moc = mc.GetInstances();
foreach (ManagementObject mo in moc)
{
if (mo["IPEnabled"].ToString() == "True")
{
mac = mo["MacAddress"].ToString();
}
}
return mac;
}