|
-
Oct 15th, 2002, 05:12 AM
#1
Thread Starter
^:^...ANGEL...^:^
MAC Address...
How do I get MAC Address for all NIC in a PC using VB...???
I have 2 NIC and I want to get MAC address for both of them...
Cheers...
Last edited by wrack; Oct 15th, 2002 at 05:28 AM.
-
Oct 15th, 2002, 06:54 AM
#2
Thread Starter
^:^...ANGEL...^:^
-
Oct 15th, 2002, 07:25 AM
#3
Addicted Member
-
Oct 15th, 2002, 08:02 AM
#4
Lively Member
Good luck
Dim szUUID
Dim szMac
Set NetworkAdapterSet = GetObject("winmgmts:").InstancesOf ("Win32_NetworkAdapter")
iMACCount = 0
For Each NetworkAdapter In NetworkAdapterSet
If NetworkAdapter.AdapterType = "Ethernet 802.3" Then
szAdapterDescription = NetworkAdapter.Description
if NetworkAdapter.Description <> "Packet Scheduler Miniport" Then
szMAC = NetworkAdapter.MACAddress
szUUID = "00000000-0000-0000-0000-"&Replace(szMAC, ":", "")
InputBox "Based on the network adapter with the description """ & _
szAdapterDescription & """, your system's UUID would " & _
"be " & szUUID & ". This UUID has been placed in the " & _
"text area below for your convenience." , _<BR/>
"Not WFM Capable", szUUID
End If
End If
iMACCount = iMACCount + 1
Next
-
Oct 15th, 2002, 08:12 AM
#5
Thread Starter
^:^...ANGEL...^:^
Originally posted by Edilson
Good luck
Dim szUUID
Dim szMac
Set NetworkAdapterSet = GetObject("winmgmts:").InstancesOf ("Win32_NetworkAdapter")
iMACCount = 0
For Each NetworkAdapter In NetworkAdapterSet
If NetworkAdapter.AdapterType = "Ethernet 802.3" Then
szAdapterDescription = NetworkAdapter.Description
if NetworkAdapter.Description <> "Packet Scheduler Miniport" Then
szMAC = NetworkAdapter.MACAddress
szUUID = "00000000-0000-0000-0000-"&Replace(szMAC, ":", "")
InputBox "Based on the network adapter with the description """ & _
szAdapterDescription & """, your system's UUID would " & _
"be " & szUUID & ". This UUID has been placed in the " & _
"text area below for your convenience." , _<BR/>
"Not WFM Capable", szUUID
End If
End If
iMACCount = iMACCount + 1
Next
sorry but this seems to be incorrect bcos it gives wrong MAC Address...
Plus I need both 2 MAC address for both NICs...
Cheers...
-
Oct 15th, 2002, 08:20 AM
#6
Lively Member
-
Oct 16th, 2002, 03:15 AM
#7
Hyperactive Member
hi -
If U are still having problems - could the following be adapted? (they only get return 1 mac address but maybe could be changed in some way - dunno...)
http://www.mvps.org/vbnet/index.html...macaddress.htm
(or even
http://www.mvps.org/vbnet/index.html...ressremote.htm )
(there is some very good example code on that site)
cheers, A.J.P
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|