Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to get the Path of logical drive
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00274325
Message ID:
00274342
Vues:
21
>I need to know how to get the path of a logical drive.
>
>If I connect \\server\C to F: acrros the network neigborhood how can I get the path using the logical drive.
>
>I can do this with a MS-DOS command line: Net use F: \\Server\C /yes
>
>When I double click in My PC icon I see C in "Server" (F:).
>
>I think must exist an api call to get it.

Hi Jose,

I think what you're referring to the the server/volume. If so, the following will probably get the information you need:
DECLARE INTEGER WNetGetConnection IN Win32API;
  STRING @lpszLocalName, STRING @lpbuffer, INTEGER @lnbufsize
* lcdevice is something like F:
lcbuffer = SPACE(200)
lnsize = LEN(lcbuffer)
IF WNetGetConnection(@lcdevice, @lcbuffer, @lnsize) = 0
  lcbuffer = LEFT(lcbuffer, AT(CHR(0), lcbuffer) - 1)
ENDIF
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