Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to get the User ID...
Message
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Miscellaneous
Thread ID:
00513880
Message ID:
00514077
Views:
12
>>In Whistler SYS(0) has the machine name, followed by the UserID in position 19.
>>
>>>No! This return the Machine name. In our case the machine name will be deferent then the user ID.
>>>

>>>>JR,
>>>>
>>>>Can you get what you want from SUBSTR(SYS(0), 19) ?
>>>>
>>>>>I have a client with Old FPW 2.x appl. The client are user a GPLib.fll to get the User ID. For some reasions the function that get the User ID do not Work on Window 2000.
>>>>>
>>>>>I know we had a way, back in the old days, to get User ID in FPW2.6 with a call to FoxToll or Win API.
>>>>>
>>>>>Any one remember's HOW?
>
>I can't remember who posted this on UT, but I think it was George Tasker!
>I also make sure that when WinXX is installed the userid is put into the 'computer name', in the network control panel.
>
>
>FUNCTION GetUserID
>LOCAL lcNull, lcUserID, lnLen
>lcNull = ''
>lcUserID = SPACE(255)
>lnLen = 255
>IF _WINDOWS AND ( "NT" $ OS() OR "WINDOWS 4" $ UPPER(OS()) )
>	* Use the WNetGetUser function in the Win32API to get the user ID
>	DECLARE INTEGER WNetGetUser IN WIN32API String @, String @, Integer @
>	IF WNetGetUser(@lcNull,@lcUserID,@lnLen) = 0
>		lcUserID = UPPER(LEFT(lcUserID,AT(CHR(0),lcUserID)-1))
>	ELSE
>		lcUserID = ""
>	ENDIF
>ENDIF
>RETURN ALLTRIM(lcUserID)
>
Jerry,

This is a FPW 2.x question, that's why my response is the way it is.
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform