Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting User Names
Message
From
11/10/2001 14:48:51
 
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00566514
Message ID:
00567163
Views:
13
>put this in your procedure lib
>
>PROCEDURE NetworkID
>LOCAL LocalName, UserName, BufferSize
>m.LocalName = CHR(0)
>m.UserName = SPACE(40)
>m.BufferSize = LEN(UserName)
>
>DECLARE INTEGER WNetGetUser ;
> IN WIN32API ;
> AS GetUserID ;
> STRING LocalName, ;
> STRING @UserName, ;
> INTEGER @BufferSize
>
>cErrorCode = GetUserID(LocalName, @UserName, @BufferSize)
>
>RETURN TRANSFORM(STRTRAN(m.UserName,CHR(0)))

This code gives me the login id of the current user. I looked
it up in MSDN and sometimes they refer to it as Username and
other times they call it a UserId or LoginId.

Apparently, what I'm trying to do is supply the LoginId and
have the OS return to me the FullName, something along the
lines of:

? FullName("KTONGE") && RETURNS: KEITH TONGE

   ...kt
Previous
Reply
Map
View

Click here to load this message in the networking platform