Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Connect to shared folder on peer-to-peer network
Message
From
10/04/2002 11:25:33
 
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00609221
Message ID:
00643234
Views:
7
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform