Advertisement
2002ASP String Manipulation #489

CurUserName

Get the current username from Windows

AI

AI Summary: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Source Code
original-source
' Get the current username from Windows
' Coded By MAGiC MANiAC^mTo
' More Examples At: http://home.kabelfoon.nl/~mto/
'
Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" _ (ByVal lpBuffer As String, nSize As Long) As Long
Function CurUserName$()
 Dim sTmp1$
 sTmp1 = Space$(512)
 GetUserName sTmp1, Len(sTmp1)
 CurUserName = Trim$(sTmp1)
End Function
Original Comments (3)
Recovered from Wayback Machine