Retrieve Ethernet Adapter

bpayne111

Junior Contributor
Joined
Feb 28, 2003
Messages
325
Location
BFE
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
 
you could add a reference to System.Management , then retrieve the Mac Addresses of any network cards like this ...
Visual Basic:
'/// 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
 
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
 
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
 
Back
Top