Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Retrieving environmental variables
Message
 
À
24/03/2003 16:53:25
Jerry Tovar
Dana Corporation Dana It
Maumee, Ohio, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00769470
Message ID:
00769495
Vues:
17
This message has been marked as the solution to the initial question of the thread.
Hi Jerry,

The Server object is an instance of the System.Web.HttpServerUtility class. This object has properties and methods allowing you to get and set information regarding the machine where the Web server is running. To get the machine name use the following:
string ServerName = Server.MachineName;
>I have code I want to fire when my .aspx page is running on my development web server vs my production web server.
>
>I am trying to read an environmental variable that I have set on my web servers. However, the following returns a blank in a ASP.Net page, but the following works fine in a C# WinForm.
>
>string lcVar = System.Environment.GetEnvironmentVariable("MYVAR");
>
>How can a Asp.Net page read an environmental variable on the web server? Or, is there a better way to determine which web server the web application is running from?
>
>Thanks,
>
>Jerry
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform