Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

ok if you run ipconfig/all you'll see a line that says 'Ethernet Adapter'

somtimes this adapter has a huge hex value next to it.

 

i'd like to be able to run ip config and extract this crazy hex value from it.

 

any ideas?

 

thanks

brandon

i'm not lazy i'm just resting before i get tired.
  • Leaders
Posted

you could add a reference to System.Management , then retrieve the Mac Addresses of any network cards like this ...

'/// add a reference to System.Management , then use the following code.
       Dim mObject As New Management.ManagementClass("Win32_NetworkAdapter")
       Dim mCol As Management.ManagementObjectCollection = mObject.GetInstances
       Dim m As Management.ManagementObject

       For Each m In mCol
           Console.WriteLine(m.Properties("MACAddress").Value)
       Next

Posted

hey thanks...

 

that's some great code but the mac address isn't what i'm looking for.

the property i'm looking for well i'm not really sure of the name. (i can't even think of how to explain it)

 

how could i make that return all properties for the adapter? so i can browse through them and get the thing i'm looking for?

 

ohh and just so you know why i'm looking for this info... (to show it's for good purpose)

i'm trying to check a registry entry for users on our vpn, to ensure it was input correctly. if not i want to add the value myself.)

 

 

thanks

brandon

i'm not lazy i'm just resting before i get tired.
Posted

actually i'm looking for the 'name' of the adapter.

i got the value i want but it took 100 lines of code to do it

thanks for the link though i'll keep that code on file

 

 

brandon

i'm not lazy i'm just resting before i get tired.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...