Abundant Technologies - IT Consulting Experts

 Source Code Library

 Code Details

 
Public Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" _ (ByVal lpBuffer As String, nSize As Long) As Long Public Function GetLoginInfo() As String Dim lResult As Long Dim lLengthUserName As Long Dim sUserName As String lLengthUserName = 255 sUserName = Space(lLengthUserName) ' Call GetUserName to find out who is logged onto this system. lResult = GetUserName(sUserName, lLengthUserName) If lResult = 0 Then MsgBox "Error: Unable to Retrieve Login Info" Exit Function End If GetLoginInfo = Left(sUserName, lLengthUserName - 1) End Function

Mail To: info@3pc.com