Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > MAC/physical address?

Reply
Thread Tools

MAC/physical address?

 
 
SJ
Guest
Posts: n/a
 
      01-07-2006
I know I can use System.Management library, but it returns like 6 different
values all
of which look like MAC addresses. Which one do I pick and how do I identify
it?
ManagementClass oMClass = new ManagementClass
("Win32_NetworkAdapterConfiguration");

ManagementObjectCollection colMObj = oMClass.GetInstances();

foreach(ManagementObject objMO in colMObj)

{

if(objMO["MacAddress"] != null)

MACAddress += objMO["MacAddress"].ToString();

}



 
Reply With Quote
 
 
 
 
Dominick Baier [DevelopMentor]
Guest
Posts: n/a
 
      01-07-2006
hi,

i wrote a tool to configure your network adapter from the command line -
this shows you how to retrieve the MAC address

http://www.leastprivilege.com/UPDATE...Windows21.aspx

---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com

> I know I can use System.Management library, but it returns like 6
> different
> values all
> of which look like MAC addresses. Which one do I pick and how do I
> identify
> it?
> ManagementClass oMClass = new ManagementClass
> ("Win32_NetworkAdapterConfiguration");
> ManagementObjectCollection colMObj = oMClass.GetInstances();
>
> foreach(ManagementObject objMO in colMObj)
>
> {
>
> if(objMO["MacAddress"] != null)
>
> MACAddress += objMO["MacAddress"].ToString();
>
> }
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments