Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Re mapping via foxpro
Message
 
À
04/10/2001 10:11:03
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00564113
Message ID:
00564165
Vues:
23
This message has been marked as a message which has helped to the initial question of the thread.
>either way...

The easiest way (and the one I'll demonstrate here) is to use the Windows Script Host's WScript.Network object.
oNet = CREATEOBJECT('WScript.Network')
oDrives = oNet.EnumNetworkDrives()
* Get the drive and server/share
FOR lni = 0 TO oDrives.Length - 1 STEP 2
  ? "Drive " + oDrives.Item(lni), "Server/Share " + oDrives.Item(lni + 1)
NEXT
* Map a drive using the current user/password
oNet.MapNetworkDrive("F:", "\\server\share") && There are other optional parameters
* Disconnect
oNet.RemoveNetworkDrive("F:")
Additional information may be found in the series of articles that Ed Rauh and I wrote in the VFUG newletter beginning Sept. 2000. The one covering this object appeared in the December issue. It's available on-line at www.vfug.org.

If the WSH isn't available, let me know and I can post API code that does the same thing.
George

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

Click here to load this message in the networking platform