Hola aca tenes dos codigos con api, para el usuario y para la Mac
Option Explicit
Private Declare Function GetUserNameA Lib "advapi32.dll" (ByVal lpBuffer As String, nSize As Long) As Long
Private Sub Form_Load()
MsgBox GetUserName
End Sub
Public Function GetUserName() As String
Dim sBuff As String
sBuff = String(100, Chr$(0))
Call GetUserNameA(sBuff, 100)
GetUserName = Left$(sBuff, InStr(sBuff, Chr$(0)) - 1)
End Function
'---------------------------------------------------------------------------------------
' Module : mGetMacAddr
' Author : Karcrack
' Now : 27/12/2010 22:28
' Purpose : Retrieve Mac Address
' History : 27/12/2010 First cut .....................................................
' Reference : http://www.codeguru.com/cpp/i-n/network/networkinformation/article.php/c5451
'---------------------------------------------------------------------------------------
Option Explicit
'RPCRT4
Private Declare Function UuidCreateSequential Lib "RPCRT4" (ByRef tUUID As UUID) As Long
Private Type UUID
a As Currency
b As Integer
c(5) As Byte
End Type
Public Function GetMacAddr() As String
Dim tUUID As UUID
Call UuidCreateSequential(tUUID)
GetMacAddr = Hex$(tUUID.c(0)) & "-" & Hex$(tUUID.c(1)) & "-" & Hex$(tUUID.c(2)) & _
"-" & Hex$(tUUID.c(3)) & "-" & Hex$(tUUID.c(4)) & "-" & Hex$(tUUID.c(5))
End Function