[Lazarus] real user name

Marco van de Voort marcov at stack.nl
Wed Dec 3 10:38:54 CET 2008


On Tue, Dec 02, 2008 at 10:02:57PM +0100, Andrea Mauri wrote:
> there is a way in order to get the real name of a linux/windows user?
> In order to get the login name (linux) I used:
>   Result.Name:= GetEnvironmentVariable('USERNAME');
>   if Result.Name = '' then
>     Result.Name:= GetEnvironmentVariable('USER');
> 
> I know that in linux I can use libc (getpwuid(fpgetuid)^.pw_gecos) but I 
> am trying to avoid use of libc.

Have a look at the users package. This is afaik 2.2.2+ though.



More information about the Lazarus mailing list