Page 1 of 1

Get "Name" of the person "Logged On" to the

Posted: Fri Jan 18, 2013 10:18 am
by Darren
Can anybody tell me how I can get the current "User Name" of the person logged onto the computer?

Get "Name" of the person "Logged On" to the

Posted: Thu Jan 24, 2013 4:34 pm
by Marco
`get username

Declare GetUserName as "GetUserNameA" of advapi32.dll
  lpBuffer As string byaddress
  nSize As Long
  result as long
end declare

dim b as integer
b=250
getusername.nsize=varptr(b)
getusername.execute
if getusername.result=true then
  showmessage getusername.lpbuffer
else
  showmessage "Error,Username not found"
end if

best regards