473,320 Members | 1,887 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,320 software developers and data experts.

Request.ServerVariables("REMOTE_ADDR") vs. Request.UserHostAddress

hn
I would like to get the visitor's ip address. Which one is the appropriate
one to use:
Request.ServerVariables("REMOTE_ADDR") or Request.UserHostAddress?

Thanks in advance.
Nov 19 '05 #1
3 11655
"hn" <hn@discussions.microsoft.com> wrote in message
news:48**********************************@microsof t.com...
I would like to get the visitor's ip address. Which one is the appropriate
one to use:
Request.ServerVariables("REMOTE_ADDR") or Request.UserHostAddress?


I'd use Request.UserHostAddress, as the former is more for compatibility
with ASP.

Of course, you realize you're as likely to get the address of a NAT box or
proxy server as you are to get the real IP address of your visitor?

John Saunders
Nov 19 '05 #2
hn
Hi John,

I remember I read somewhere that Request.ServerVariables("REMOTE_ADDR")
would give you the real address, but I'm not so sure. Anyway,
Request.UserHostAddress is good enough for me. Thanks for the quick reply,
John.

"John Saunders" wrote:
"hn" <hn@discussions.microsoft.com> wrote in message
news:48**********************************@microsof t.com...
I would like to get the visitor's ip address. Which one is the appropriate
one to use:
Request.ServerVariables("REMOTE_ADDR") or Request.UserHostAddress?


I'd use Request.UserHostAddress, as the former is more for compatibility
with ASP.

Of course, you realize you're as likely to get the address of a NAT box or
proxy server as you are to get the real IP address of your visitor?

John Saunders

Nov 19 '05 #3
"hn" <hn@discussions.microsoft.com> wrote in message
news:2B**********************************@microsof t.com...
Hi John,

I remember I read somewhere that Request.ServerVariables("REMOTE_ADDR")
would give you the real address, but I'm not so sure. Anyway,
Request.UserHostAddress is good enough for me. Thanks for the quick reply,


Request.ServerVariables("REMOTE_ADDR") can't give you any "real address",
since no "real address" is ever sent.

An IP address is something used at the network layer, and shouldn't really
be used by your application. If your application needs to know the identity
of the sending machine, then it should use something like X.509
certificates, which are meant to represent identity (an IP address is not).

John Saunders
Nov 19 '05 #4

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

Similar topics

0
by: Vilmar | last post by:
Hi, Can Request.ServerVariables("REMOTE_ADDR") fail and catch the address of my default gateway in my local network?? What should I do? Sometimes brings 192.168.0.1(the address of my default...
9
by: Luc Dal | last post by:
Hello, I've serious problem using ASP under WindowsXP sp2. I get the following reply (sorry it's in french) Erreur de compilation Microsoft VBScript error '800a0401' Fin d'instruction...
3
by: Charles Stanley | last post by:
Hi all, I'm new to C#, and have two pretty simple questions: I have a class, in a .cs file by itself. I need to make use of the sole function in this class in another .cs file. Here's the...
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. ...
6
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of...
1
by: mcarten | last post by:
I'm getting the dreaded "nullreferenceexception" error with this code. In an ASP application it works fine. In VB Express 2005 it does not. These are my imports .... Imports System Imports...
5
by: Pseudonyme | last post by:
Dear All : Ever had an httpd error_log bigger than the httpd access log ? We are using Linux-Apache-Fedora-Httpd 2006 configuration. The PHP lines code that lead too tons of errors are : ...
2
by: Henry Stock | last post by:
I don't seem to understand how to use the value: Request.ServerVariables("remote_addr") I am trying to pass the ip address of a sending web client in the body of an email message. When I...
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...
1
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...
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)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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.