R
Rene
All I want is to retrieve the insonet little MAC address of my network
adapter using C#, the code that I was planning on using is as follows:
---------------------------------------------------------------------------
System.Management.ManagementClass mc = new
System.Management.ManagementClass("Win32_NetworkAdapterConfiguration");
System.Management.ManagementObjectCollection moc = mc.GetInstances();
foreach(System.Management.ManagementObject mo in moc)
{
if((bool)mo["IPEnabled"] == true)
MessageBox.Show(mo["MacAddress"].ToString());
}
---------------------------------------------------------------------------
If I run this code on aregular installation of Windows XP everything works
fine, but if I do it on my XPE image it crashes although I do include the
System.Management.dll file on the image. Can someone tell me what am I
missing? Can one of you try to run this code in your XPE image to see if you
get an error?
Note: You must include the "System.Management" in your project in order for
this code to work.
Thank you
adapter using C#, the code that I was planning on using is as follows:
---------------------------------------------------------------------------
System.Management.ManagementClass mc = new
System.Management.ManagementClass("Win32_NetworkAdapterConfiguration");
System.Management.ManagementObjectCollection moc = mc.GetInstances();
foreach(System.Management.ManagementObject mo in moc)
{
if((bool)mo["IPEnabled"] == true)
MessageBox.Show(mo["MacAddress"].ToString());
}
---------------------------------------------------------------------------
If I run this code on aregular installation of Windows XP everything works
fine, but if I do it on my XPE image it crashes although I do include the
System.Management.dll file on the image. Can someone tell me what am I
missing? Can one of you try to run this code in your XPE image to see if you
get an error?
Note: You must include the "System.Management" in your project in order for
this code to work.
Thank you