473,326 Members | 2,148 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Always 'localhost' from Request.ServerVariables["SERVER_NAME"]

I am wanting to get the machine name that is running IIS. I have code in
the 'Application_BeginRequest' event of the Global.asax and even if I access
the web site from another machine I am always getting 'localhost' in the
SERVER_NAME variable. Any way to get the actual machine name?

LWS
Nov 18 '05 #1
1 4668
See
http://msdn.microsoft.com/library/de...rvariables.asp
for the intended meaning of the SERVER_NAME server variable. For the local
machine name on the server, try using System.Environment.MachineName
instead.

HTH,
Nicole

"L Scott" <la*********@enron.com> wrote in message
news:uo*************@TK2MSFTNGP11.phx.gbl...
I am wanting to get the machine name that is running IIS. I have code in
the 'Application_BeginRequest' event of the Global.asax and even if I
access
the web site from another machine I am always getting 'localhost' in the
SERVER_NAME variable. Any way to get the actual machine name?

LWS

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Michael Brennan-White | last post by:
If I submit my for using a get action the resulting page loads . If I use a post action I get an error page saying "The page cannot be found". I am calling the originating page!!! This happens...
0
by: martin de vroom | last post by:
Hi, I am trying to put a condition in my Global.asa file based on the server name. the reason, I want to set a global string as a application variable based on the server I am on. I also...
6
by: Meya | last post by:
Hi, when I hit my http://<domain name> site,I am getting this error msg: I have also installed my SSL cert on the IIS 5.0 ******************************** The page must be viewed over a...
4
by: JT | last post by:
if i am using https, will this work the same as if i were using http? Request.ServerVariables("HTTP_HOST") returns www.mywebsite.net for http. what about https?????
3
by: Erik T. Nomad | last post by:
I've created a link that will enable the reader of any page on my website to click it, enter an e-mail address, and have it arrive in that inbox with a hyperlink to the site. However, I'm...
5
by: Neil Rossi | last post by:
I have an issue with a particular ASP page on two web servers. Let's call these servers Dev1 and Beta1. Both Servers are running IIS 5, Windows 2000 SP4 with "almost" all of the latest patches. ...
4
by: Lloyd Dupont | last post by:
I can't use Control.ResolveUrl because I need to write the conversion in a utility class. However I know the current context. How could I convert the URL to one usable by the user? -- I have...
0
by: Patrick | last post by:
Greetings, I'm running into an intermittant issue on a web site running dotNet 1.1 sp1. The global.asax the client is using is set up so that it can be used in production, developement, and...
2
by: E L | last post by:
We have the Request.ServerVariables("SERVER_NAME") used in a classic ASP page using IIS 6. It used to return our website name: www.xxx.name.this when using IIS 5, now it is returning the IP...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.