Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Get contents of a Drive Mapping assignment?
Message
De
09/02/2006 16:47:57
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows Server 2003
Divers
Thread ID:
01095260
Message ID:
01095274
Vues:
10
Thanks, Yuri. Looks like that will do it nicely, if it works under Citrix, which I expect it to.

>Something like below.
>
>?iGetUncPath("f:")
>
>FUNCTION iGetUncPath
>
>LPARAMETER tcDrive
>* must be in format "c:"
>tcDrive=left(alltr(tcDrive),2)
>if not isalph(tcdrive)
>	wait wind "Usage: do ... with 'c:'"
>	return
>endif
>if len(tcdrive)=1
>	tcdrive=tcdrive+":"
>endif
>tcdrive=left(tcdrive,2)
>
>DECLARE LONG WNetGetConnection IN WIN32API STRING lpszLocalName, STRING @lpszRemoteName, LONG @lSize
>lpszRemoteName = SPACE(255)
>lnSize = LEN(lpszRemoteName)
>lnErr = WNetGetConnection(tcDrive, @lpszRemoteName, @lnSize)
>IF lnErr = 0
>	lcRetval = LEFT(lpszRemoteName, ATC(CHR(0),lpszRemoteName) - 1)
>ELSE
>	lcRetval = "Error: " + STR(lnErr)
>ENDIF
>RETURN lcRetVal
>
>
>>Anybody got an easy way to grab the \\server\share info from a mapped drive letter? I need to add the path of a mapped drive letter to our app's disgnostic screen, and it needs to work when running on Citrix, too.
>>
>>I'm posting here because it might require an API call, but if you know of another way that's reliable, I'm all ears for that, too.
David Stevenson, MCSD, 2-time VFP MVP / St. Petersburg, FL USA / david@topstrategies.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform