PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Andy Flowers on March 21, 2009, 06:33:36 PM

Title: Retrieving the local username
Post by: Andy Flowers on March 21, 2009, 06:33:36 PM
I am trying to intergrate my application with the windows security. Does anyone know how to retrieve the username of the current user logged on?

Andy
Title: Re: Retrieving the local username
Post by: TechSupport on March 21, 2009, 07:50:02 PM

#Compile Exe


#Include "win32api.inc"


Function PBMain() As Long

   Local zUserName As Asciiz * %MAX_PATH
   
   GetUserName zUserName, %MAX_PATH
   
   MsgBox zUserName
   
End Function


Title: Re: Retrieving the local username
Post by: Andy Flowers on March 21, 2009, 08:31:51 PM
Thanks Paul, it works fine.