Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SYS(0) returns network name? Win2k name?
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00746427
Message ID:
00746430
Views:
19
Try
* Function GetUserName
local lcBuffer, lnSize, lnRetCode, lcUserName
lcBuffer = repl(chr(0),64)
lnSize = LEN(lcBuffer) -1
Declare Long WNetGetUserA in "mpr.dll" As GetUserName ;
				STRING @lc0, STRING @lcBuffer, LONG @lnSize
lnRetCode = GetUserName("", @lcBuffer, @lnSize )
lcUserName = left(lcBuffer, at(chr(0), lcBuffer)-1)
return lcUserName
>Hi anyone,
> I've got a boat-load of legacy apps to support which employ use of the SYS(0) function to obtain the *network* username. Now I'm testing a new username under Win98 and SYS(0) correctly returns the *network* username. However, lucky me, when using Win2k to log on with this new network username, I find that SYS(0) does *not* return the new network username -- it, and ID() as well, returns my Win2k *Windows* username. Duh?
> Any similar experiences? Solutions to obtaining *network* username?
>
>Thanks,
>Steven-
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform