Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Finding out who the user is...
Message
De
27/01/1999 07:42:35
 
 
À
27/01/1999 04:37:50
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00178748
Message ID:
00180670
Vues:
25
>WNetGetUser() works identically on all Win32 platforms (Win9x, WinNT for all VFP-supported versions, and WinCE since verison 2.0); the example given retrieves the userid used to log into Windows locally, so it doesn't care about OS in any case. It should work to identify the userid used to attach a remote resource that's accurate to Windows, but may need to be parsed (for example, you'll get the login ID back when attaching a resource on a remote NT box, but that ID might be qualified with a domain or machine context; eg my local login ID is Administrator, but the id used to attach my G: drive is my domain login, EDHOME\Administrator.)
>
>If you want to get the userid used to attach a network resource, substitute the name of the resource for lcNull. Using the example above:
>
>WNetGetUser("Z:" + CHR(0),@lcUserId,@lnLen)
>
>would attempt to get the userid used to attach the remote resource mapped as Z: locally; this works with printers as well. The device must be mapped to a local resource; you can't check the connection to a UNC this way.

Ed,
WNetGetUser returns my username no matter what I throw at it, be it a local drive, a mapped drive, a mapped printer or even just garbage like 'æøå'.
Is this expected behaviour?

Arne

P.S. While I'm at it, I'd just like to say thanks for lots of useful info shared!
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform