关于网卡的MAC地址的问题
private void Button11_Click(object sender, System.EventArgs e){
ManagementClass mc = new ManagementClass("Win32_NetworkAdapterConfiguration");
ManagementObjectCollection moc = mc.GetInstances();
foreach(ManagementObject mo in moc)
{
if((bool)mo["IPEnabled"] == true)
Response.Write("MAC address"+mo["MacAddress"].ToString()+"<br>");
mo.Dispose();
}
}
这段代码中if(if((bool)mo["IPEnabled"] == true) )是什么意思?还有foreach(ManagementObject mo in moc)这个也看不大懂,请大家指点一下。