Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get the full user's name of the PC
Message
 
 
To
15/06/2009 17:19:06
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01406221
Message ID:
01406226
Views:
91
Hi Tracy,

I wanted the actual name for the Header in intellisense. This code still returns the same as ID() does - it gave me the same string - not my actual First and Last Name.

>>Hi everybody,
>>
>>How can I get my full user's name instead of what ID() function returns?
>>
>>Thanks in advance.
>
>do you mean the NT username?
>
>(it's also here:)
>http://support.microsoft.com/kb/139625
>
>
>
>*--George: dbfForums 2007
>*---+ Get Windows NT Username
>private lcUserIDBuffer, lnBufferSize, RetVal
>
>RetVal         = 0
>lcUserIDBuffer = Space(25) && Return buffer for user ID string
>lnBufferSize   = 25        && Size of user ID return buffer
>
>Declare Integer GetUserName In Win32API As GetName;
>        String  @lcUserIDBuffer,;
>        Integer @lnBufferSize
>
>RetVal = GetName(@lcUserIDBuffer, @lnBufferSize)
>
>lcNTUsername = Left(lcUserIDBuffer, lnBufferSize-1)
>
>If empty(lcNTUsername)
>	lcNTUsername = "Unknown"
>ENDIF
>?lcNTUsername
>*---+ Username retrieved.
>
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform