Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to get informations from the NT Server
Message
From
24/02/1998 07:35:32
Bob Tracy
Independent Consultant
Driftwood, Texas, United States
 
 
To
24/02/1998 02:53:08
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00080701
Message ID:
00080727
Views:
27
>Is it possible to get informations from the NT Server. Such as your login name. The groups you may be part of and so on?
>
>Hope someone can help me.
Try this for user name:

PUBLIC lpUserIDBuffer
LOCAL nBufferSize, ;
RetVal
RetVal = 0
lpUserIDBuffer = SPACE(25) && Return buffer for user ID string
nBufferSize = 25 && Size of user ID return buffer
DECLARE INTEGER GetUserName IN Win32API AS GetName ;
STRING @lpUserIDBuffer, ;
INTEGER @nBufferSize
RetVal=GetName(@lpUserIDBuffer,@nBufferSize)
RETURN LEFT(lpUserIDBuffer,nBufferSize-1)

I've also seen several threads about this here on the UT and also some articles in the MS knowledge base. Also, take a look at WIN32API.hlp in your VFP directory.
Bob Tracy

Never engage in a battle of wits if you're only half armed.
Previous
Reply
Map
View

Click here to load this message in the networking platform