Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Check server name
Message
From
07/08/2002 06:44:03
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
07/08/2002 06:26:10
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00686926
Message ID:
00686937
Views:
60
>sys(0) is giving me the user name and the local workstation name.
>what i am looking for is somethig equivalent for the server, from where my application.exe file is called from.
>
>eg if it is started from \\server1\appdir\ some application should not be available, if it is startet from a local computer it should be available.
>
>Regards
>ernst

sys(16,0) would return the fullpath of exe (or application.servername).
If it's a mapped drive than wouldn't be sufficient. Then you could use WNetGetConnection :
declare integer WNetGetConnection in win32API ;
  string @ lpLocalName, ;
  string @ lpRemoteName,  ;
  integer @ lpnLength

lpLocalName = "z:" && drive letter
lpRemoteName = space(512)
lpnLength = 512


if WNetGetConnection(lpLocalName, @lpRemoteName, @lpnLength) = 0
 ? substr(lpRemoteName, 1, lpnLength)
endif
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform