Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Check server name
Message
De
07/08/2002 06:44:03
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
07/08/2002 06:26:10
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00686926
Message ID:
00686937
Vues:
59
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform