Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Server Name
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Miscellaneous
Thread ID:
00139429
Message ID:
00139488
Views:
48
>>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.
Previous
Reply
Map
View

Click here to load this message in the networking platform