Results 1 to 1 of 1

Thread: Get Mac Adress

  1. #1
    Senior Member The_USDL is on a distinguished road The_USDL's Avatar
    Join Date
    2011 Oct
    Thanked 538 Times in 47 Posts
    Rep Power

    Get Mac Adress

    Option Explicit
    Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (ByRef Destination As Any, ByRef Source As Any, ByVal numbytes As Long)
    Private Declare Function GetAdaptersInfo Lib "iphlpapi.dll" (ByRef pAdapterInfo As Any, ByRef pOutlLenght As Long) As Long
    Public Function MacAddress() As String
        Dim bBuf()  As Byte
        Dim bMAC(7) As Byte
        Dim lSecond As Long
        Dim lType   As Long
        Dim lLenght As Long
        Dim i As Long
        Dim str As String
        Call GetAdaptersInfo(0&, lLenght)
        ReDim bBuf(0 To lLenght - 1) As Byte
        Call GetAdaptersInfo(bBuf(0), lLenght)
        CopyMemory lSecond, ByVal VarPtr(bBuf(0)), 4
        CopyMemory lType, ByVal lSecond + &H1A0, &H4
        CopyMemory bMAC(0), ByVal lSecond + &H194, &H8
        If (lType = 6) Then
            For i = 0 To 5
                If Len(Hex(bMAC(i))) = 1 Then
                    MacAddress = MacAddress & "0" & Hex(bMAC(i))
                    MacAddress = MacAddress & Hex(bMAC(i))
                End If
                If i < 5 Then MacAddress = MacAddress & "-"
            Next i
        End If
    End Function
    Like it? Click in Thanks!

  2. The Following User Says Thank You to The_USDL For This Useful Post:

Visitors found this page by searching for:

vb6 get mac address

get mac address in vb6.0

get mac address using vb6

get mac address vb6

how to get mac address in vb6

get mac address in vb6

vb mac address

how to get mac address using vb6

mac address code in vb6.0

GetAdaptersInfo mac vb6


vb6 mac address

how to find mac address in vb6

function GetMac GetAdaptersInfo

vb get mac address

vb6 retrieve mac address

get mac address

.net framework 4.0 copymemory

how to get mac address in vb6.0

macaddress in vb6.0

get mac address in

visual basic get mac address

iphlpapi.dll get mac address vb6

vb6 get mac address getadaptersinfo

getadaptersinfo vb6 mac


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts