Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SYS(0) returns network name? Win2k name?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00746427
Message ID:
00746430
Vues:
20
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--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform