Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Map Drive Letter
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01100869
Message ID:
01101154
Vues:
14
try the following

DECLARE INTEGER WNetAddConnection IN win32api;
STRING, STRING, STRING
WNetAddConnection('Computer Name','Password','DriveLetter:')

>I want to map Z:\ to \\GA016FT3\RT2006\tempdbfs\ folder. I found this code on a previous thread, but in the debugger I can not understand how it maps a new drive.
>
>
>
>lcDrv = " "  && Network Drive
>
>DECLARE INTEGER WNetGetConnection IN win32api ;
>	STRING lpszLocalName,;
>	STRING lpszRemoteName,;
>	INTEGER @ lpchBuffer && Declare the external WNetGetConnection API
>function
>slpRemoteName = SPACE(254)  && Intialize Variables
>slen = LEN(slpRemoteName) && Intialize Variables
>FOR I = 1 to 26 && Loop through drive letters A thru Z to identify onnections
>	DRIVE = CHR(I +64)
>	DTYPE = DRIVETYPE(drive) && Determine drive type
>	IF dtype = 4 && Removables or network drives
>		iSuccess = WNetGetConnection(drive + ":",@slpRemoteName,@slen)
>		IF iSuccess = 0
>***			lcSrvarea = LEFT(slpRemoteName,ATC(CHR(10),slpRemoteName) - 1)
>			lcSrvarea = LEFT(slpRemoteName,AT(CHR(0),slpRemoteName) - 1)
>			IF UPPER(lcSrvarea) = "\\Server\srvr_area"
>				lcDrv = DRIVE
>			ENDIF
>		ENDIF		
> 	ENDIF
>ENDFOR
>
>
Fred Besterwitch, MCP

The harder you work. The luckier you get.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform