Obtain MAC Address

How can my application to obtain the MAC adress of the PC in wich is installed

Como puede mi aplicacion obtener la direccion MAC de la PC en la que esta instalada

Thanks!

Gracias!




Answer this question

Obtain MAC Address

  • ZopoStyle

    For Each NI As System.Net.NetworkInformation.NetworkInterface In System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces

    MessageBox.Show(NI.GetPhysicalAddress.ToString)

    Next


  • Chris Fraelic

    On Error Resume Next

    Const wbemFlagReturnImmediately = &h10
    Const wbemFlagForwardOnly = &h20

    arrComputers = Array("localhost")
    For Each strComputer In arrComputers
    WScript.Echo
    WScript.Echo "=========================================="
    WScript.Echo "Computer: " & strComputer
    WScript.Echo "=========================================="

    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
    Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapter", "WQL", _
    wbemFlagReturnImmediately + wbemFlagForwardOnly)

    For Each objItem In colItems
    WScript.Echo "MACAddress: " & objItem.MACAddress
    Next
    Next


  • Obtain MAC Address