Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Who is logged in?
Message
From
10/11/1998 16:50:04
Tyson Bonn
Myers and Stauffer Consulting
Harrisburg, Pennsylvania, United States
 
 
To
10/11/1998 16:31:56
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00156400
Message ID:
00156413
Views:
32
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform