bpayne111 Posted April 26, 2004 Posted April 26, 2004 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 Quote i'm not lazy i'm just resting before i get tired.
Leaders dynamic_sysop Posted April 26, 2004 Leaders Posted April 26, 2004 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 Quote
bpayne111 Posted April 27, 2004 Author Posted April 27, 2004 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 Quote i'm not lazy i'm just resting before i get tired.
keitsi Posted April 29, 2004 Posted April 29, 2004 http://www.xtremedotnettalk.com/showthread.php?t=71433 http://www.dotnet247.com/247reference/msgs/4/21219.aspx "Description" and "IPAddress" might be what you are looking for? just use them instead of "MACAddress" Quote BS - Beer Specialist
bpayne111 Posted April 29, 2004 Author Posted April 29, 2004 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 Quote i'm not lazy i'm just resting before i get tired.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.