Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Server Name
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
Divers
Thread ID:
00139429
Message ID:
00139488
Vues:
46
>>In a network scenario, API functions such as GetCurrentDirectory() and GetModuleFilename() return a network drive letter. Is it possible or is there a function(s) to retrieve the server name instead of the drive letter?
>>
>Hi Bill,
>
>I'm not quite sure that this is what you want (and given the problems I seem to be having in typing in the HTML tags, I'm not sure I'll type it the way I want:-)), but try this:
>DECLARE INTEGER WNetGetConnection IN Win32API;
>  STRING @lpszLocalName, STRING @lpszRemoteName,;
>  INTEGER @lpcchBuffer
>lclocal = "F:"
>lcremote = SPACE(260)
>lnsize = LEN(lcremote)
>* If 0 is returned the call succeeded
>lnerr = WNetGetConnection(@lclocal, @lcremote, @lnsize)
>IF lnerr = 0
>  lcremote = LEFT(lcremote, AT(CHR(0), lcbuffer) - 1)
>ENDIF
>hth,

Thanks George. I knew there had to be a way ... and you'd know it of there was. :-)
Bill
William A. Caton III
Software Engineer
MAXIMUS
Atlanta, Ga.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform