Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Who is logged in?
Message
De
10/11/1998 16:50:04
Tyson Bonn
Myers and Stauffer Consulting
Harrisburg, Pennsylvanie, États-Unis
 
 
À
10/11/1998 16:31:56
Sergio Ortiz
Tek Services Group, Llc
Hollywood, Floride, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00156400
Message ID:
00156413
Vues:
29
Here's a routine I run that tries to get the info from the Windows API. If it fails, it then tries the FoxPro information.
* Declare the API function.
DECLARE INTEGER GetUserName IN Win32API STRING @S, INTEGER @I

* Define the buffer size and destination variable.
lnDWord = 20
lcBuffer = SPACE(m.lnDWord + 1)	&& One for the trailing NULL

* Try the API function.
IF (GetUserName(@m.lcBuffer, m.lnDWord) = 1)
	* Use the API call results.
	lcUserID = STRTRAN(ALLTRIM(m.lcBuffer), CHR(0), [])
ELSE
	* Use the FoxPro function.
	lcUserID = ID()
ENDIF
Tyson Bonn
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform