Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Get the full user's name of the PC
Message
 
 
À
15/06/2009 17:19:06
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01406221
Message ID:
01406226
Vues:
90
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform