Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting NT user name in Win 95
Message
 
To
18/06/1998 21:17:02
Mike Siemers
Southwest Student Services
Mesa, Arizona, United States
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00109767
Message ID:
00110046
Views:
76
>I need to get the NT user name of the user currently logged in on a Win 95 client. It looks like the function is in SVRAPI.DLL. I'd also like to be able to get other information out of the NT directory for the current user, such as department, manager, etc.
Mike, here's the declaration for WNetGetUser that Robert mentioned:
DECLARE INTEGER WNetGetUser IN Win32API;
  STRING @lpszLocalName, STRING @lpszUserName,;
  INTEGER @lpcchBuffer
lcUserName = SPACE(200)
lnlength = LEN(lcUserName)
* Get current user
lnerror = WNetGetUser(0, @lcUserName, @lnlength)
IF lnerror = 0
  lnpt = AT(CHR(0), lcUserName)
  lcUserName = LEFT(lcUserName, lnpt - 1)
ENDIF
The remaining information you're looking for may be in the NT registry. However, since I don't work with NT, I can't be of any further help in this area.
George

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

Click here to load this message in the networking platform