Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Map Network Drive
Message
De
15/02/2006 16:49:09
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01096573
Message ID:
01096599
Vues:
12
In addition to Sergey response. The following line will always be false.
IF UPPER(lcSrvarea) = "\\Server\srvr_area"
If the right of the expression is really a literal string, make sure that it is in upper case.


>Hi,
>
>The following used to work for me, but now it does not.
>Any alternatives?
>
>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 connections
> 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)
> IF UPPER(lcSrvarea) = "\\Server\srvr_area"
> lcDrv = DRIVE
> ENDIF
> ENDIF
> ENDIF
>ENDFOR
Greg Reichert
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform