Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
To which directory or share is a disk letter mapped?
Message
De
04/07/2008 20:14:34
 
 
À
04/07/2008 08:08:25
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01328956
Message ID:
01329061
Vues:
17
It works. Thanks.

Alex

>Hi Alejandro,
>
>>How can you find out programmatically to which directory or share is a disk letter mapped?
>>
>>For example Z: may be mapped to "\\MyServer\MyServer_Z"
>>
>>TIA,
>>
>>Alex
>
>this is a rough code snippet of mine
>
>
>FUNCTION ConvertDrive2UNC
>LPARAMETERS vLocalName
>LOCAL lcUNCBuffer as String, liLength as Integer, lcLocalName as String, lcRemoteName as String
>
>DECLARE INTEGER WNetGetConnection IN WIN32API ;
>   STRING @ lpLocalName, ;
>   STRING @ lpRemoteName, ;
>   INTEGER @ lpliLength
>
>* Just one letter? Then generate a Drivenumber
>IF LEN(m.vLocalName) = 1
>	m.vLocalName = m.vLocalName + [:]
>ENDIF
>
>lcUNCBuffer	= REPL(CHR(0),261)
>liLength	= LEN(lcUNCBuffer)
>
>IF WNetGetConnection(m.vLocalName, @lcUNCBuffer, @liLength) = 0
>   lcRemoteName = LEFT(lcUNCBuffer,AT(CHR(0),lcUNCBuffer)-1)
>ENDIF
>
>RETURN lcRemoteName
>
>ENDFUNC
>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform