Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Script a network connection
Message
De
27/12/2000 03:16:30
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00456955
Message ID:
00456991
Vues:
22
Can you use:
- the WCONN... Functions in win32api.
- SUBST
- NET USE

Example:
DECLARE INTEGER WNetCancelConnection IN Win32API STRING, INTEGER
IF WNetCancelConnection(cDriveLetter, 1) != 0	
&& 1: disconnect by force even if any file open
nDType = 3									&& if fail to disconnect because the folder was *Substed*
ENDIF

IF nDType = 3			&& local hard disks, including *Substed* drives
	cMapCmd = "subst /d " + cDriveLetter + " > nul"
	RUN &cMapCmd
ENDIF

IF cDriveType = "NET"
	cMapCmd = "net use " + cDriveLetter + " " + cDrivePath + " > nul"
ELSE			&& regarded as "Local", do a subst instead
        cMapCmd = "subst " + cDriveLetter + " " + cDrivePath + " > nul"
ENDIF
RUN &cMapCmd
Cheers!
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform