Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Current login username
Message
 
À
08/02/2006 18:40:23
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01094665
Message ID:
01094836
Vues:
11
>Hi Steve,
>Try this:
>
>Declare Long GetUserNameEx in Secur32 ;
>   Long NameFormat, String @lpBuffer, Long @nSize
>
>nBufLen = 260
>cAccountName = repl( chr(0), nBufLen )
>If (GetUserNameEx( 3, @cAccountName, @nBufLen ) != 0)
>   ? 'Friendly Account Name: ' + left( cAccountName, nBufLen-1 )
>else
>   ** GetLastError() return 1332 if the account name was not changed from the original one
>endif
>
>Clear Dlls GetUserNameEx
>
That's it. It works!!!
In the "else" above, you could use SYS(0) method so that the function would return a value not empty.

Thank you and to all the others.
Lead programmer of the free MIS Info Video(Frontend/player), Info 2 MIS or visit me at Steve's Tech Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform