Information générale
Titre:
Retrieving environmental variables
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
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement