Results 1 to 7 of 7

Thread: MAC Address...

  1. #1

    Thread Starter
    ^:^...ANGEL...^:^ wrack's Avatar
    Join Date
    Mar 2002
    Location
    Melbourne, AUSTRALIA
    Posts
    2,695

    Thumbs up 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.

  2. #2

    Thread Starter
    ^:^...ANGEL...^:^ wrack's Avatar
    Join Date
    Mar 2002
    Location
    Melbourne, AUSTRALIA
    Posts
    2,695
    * bump *

  3. #3
    Addicted Member
    Join Date
    Aug 2002
    Location
    Belfast, N. Ireland
    Posts
    167
    * ouch! *

  4. #4
    Lively Member Edilson's Avatar
    Join Date
    Aug 2000
    Location
    Orlando
    Posts
    81
    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

  5. #5

    Thread Starter
    ^:^...ANGEL...^:^ wrack's Avatar
    Join Date
    Mar 2002
    Location
    Melbourne, AUSTRALIA
    Posts
    2,695
    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...

  6. #6
    Lively Member Edilson's Avatar
    Join Date
    Aug 2000
    Location
    Orlando
    Posts
    81
    I belive u can find some more help here

    http://support.microsoft.com/default...;en-us;Q302467

  7. #7
    Hyperactive Member
    Join Date
    Feb 2001
    Posts
    280
    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
  •  



Click Here to Expand Forum to Full Width