Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Connect to shared folder on peer-to-peer network
Message
De
10/04/2002 11:25:33
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00609221
Message ID:
00643234
Vues:
9
>Here's my little proc for mapping a network share:
>
>PROCEDURE mapdrive
> * do mapdrive with "\\servername\sharename", "k:"
> LPARAMETERS lcdrvltr, lcnetpath
> DECLARE LONG WNetAddConnection IN mpr.DLL STRING@, STRING@, STRING@
> retval=wnetaddconnection(@lcnetpath, CHR(0), @lcdrvltr)
> *remove the registered library
> CLEAR DLLS
> RETURN retval
>ENDPROC

This worked like a charm on our Win 9x systems but failed in tests on our Win 2000 systems. The latter required both a username and a password.

Within a day of signing up for PUTM, I found Ed Rauh's classes that implement WNetConnection3(), an API function which is apparently a newer version of WNetAddConnection() with the added ability to specify username and password. Yay.

I'm still playing with the classes and hope to post my review soon.

~Cheers~
Bill de Veas
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform