D
david
Hi All,
I have to get the MAC address in my program. But I didn't have the correct
property name of management object. And I don't know how to get it. Can some
one help me?
Below is my code.
Thanks,
ManagementClass adapters = new ManagementClass("Win32_NetworkAdapter");
string mac = "";
adapters.Get();
int ix =adapters.Properties.Count;
ix = adapters.Properties.Count;
foreach (ManagementObject adapter in adapters.GetInstances())
{
mac = adapter["Name"].ToString() + " " ;
mac += adapter["MACAddress"].ToString(); <--- crashed here,
propertyname is wrong.
--
David
--
David
Computer Systems Int'l
Tel : 416-497-0370 x24
Fax: 416-497-6760
Toll Free: 1-888-836-7274
www.compsysint.com
(e-mail address removed)
I have to get the MAC address in my program. But I didn't have the correct
property name of management object. And I don't know how to get it. Can some
one help me?
Below is my code.
Thanks,
ManagementClass adapters = new ManagementClass("Win32_NetworkAdapter");
string mac = "";
adapters.Get();
int ix =adapters.Properties.Count;
ix = adapters.Properties.Count;
foreach (ManagementObject adapter in adapters.GetInstances())
{
mac = adapter["Name"].ToString() + " " ;
mac += adapter["MACAddress"].ToString(); <--- crashed here,
propertyname is wrong.
--
David
--
David
Computer Systems Int'l
Tel : 416-497-0370 x24
Fax: 416-497-6760
Toll Free: 1-888-836-7274
www.compsysint.com
(e-mail address removed)