Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Question on WNetAddConnection
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00205741
Message ID:
00205752
Vues:
16
>All I am trying to map a network drive from WIN NT workstation with
>WNetAddConnection:
>
>DECLARE Integer WNetAddConnection IN WIN32API STRING @, STRING @, STRING @
>lcRemoteName = "\\Computer\Resource"
>lcPassword = "" && Connect using no password
>lcLocalName = "E:"
>
>? WNetAddConnection( @lcRemoteName, @lcPassword, @lcLocalName)
>
>
>Returns error 1326 (invalid User I think). Can I pass a User-ID to this function?? if so where does it go in the declare and call?
>
>Thanks

Paul,

In order for Windows to use the password from its list, you must pass a null pointer. So
? WNetAddConnection(@lcRemoteName, 0, @lcLocalName)
is what you need.

1326 is logon failed and could be caused by passing an empty string rather than null pointer. If you have the password, just pass it by reference.

hth,
George

Ubi caritas et amor, deus ibi est
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform