Try
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--