Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Mapping network drive in Windows2000
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00718773
Message ID:
00718782
Vues:
21
>Hi all,
>I have used an API function to map a network drive and it works nicely when run on Win9x. However, it fails on Windows2000.
>The function I used (see below) appears to be a 16 bit API call. Has anyone had any luck implementing this on Windows2000? Or, some other alternative?
>
>FUNCTION ConnectToDrive
>PARAMETERS tcPath, tcPassword, tcDrvLetter
>
> PRIVATE ALL LIKE j*
> jcPath = tcPath
> jcPassword = tcPassword
> jcDrvLetter = tcDrvLetter
>
> DECLARE Integer WNetAddConnection IN Win32api string, string, string
>
> jnConnected = WNetAddConnection(jcPath, jcPassword, jcDrvLetter)
>RETURN IIF(jnConnected = 0, .T., .F.)

In addition to the WSH, there's a working example of WNetAddConnection3() in my NETRESOURCE class (in the downloads section) which allows you to give name, password and domain information rather than relying on the data in your Windows login, and is a Win32 API call rather than a legacy call from Win16.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform