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

Request.UserHostAddress

tma
I am creating code that makes decisions based on the result of the
Request.UserHostAddress. Is there a way I can search on /CIDR or range of IP
addresses without specifying an exact search string, i.e. one string for
each IP address? You can imagine why I don't want to have to create a
CASE/ELSE for this scenario...

I'm open to any suggestions.

Nov 18 '05 #1
5 3131
"tma" <tm*@allisconfusing.net> wrote in message
news:ed**************@TK2MSFTNGP11.phx.gbl...
I am creating code that makes decisions based on the result of the
Request.UserHostAddress. Is there a way I can search on /CIDR or range of
IP
addresses without specifying an exact search string, i.e. one string for
each IP address? You can imagine why I don't want to have to create a
CASE/ELSE for this scenario...

I'm open to any suggestions.


I presume you're guaranteed what the IP addresses are, and that they won't
ever change or be placed behind a NAT box or something that will change the
IP addresses? Or that the subnet setup won't change?

Why not identify machines with something like an X.509 certificate, which is
_meant_ to be identifying? IP addresses aren't actually meant for that
purpose.

John Saunders
Nov 18 '05 #2
tma
Actually, the IP addresses are from "people" who hit my website. Spiders for
example. So while the address space is fairly constant, it still needs to be
a range of addresses to test for.

Any thoughts?
"John Saunders" <jo**************@hotmail.com> wrote in message
news:uS*************@TK2MSFTNGP10.phx.gbl...
"tma" <tm*@allisconfusing.net> wrote in message
news:ed**************@TK2MSFTNGP11.phx.gbl...
I am creating code that makes decisions based on the result of the
Request.UserHostAddress. Is there a way I can search on /CIDR or range of IP
addresses without specifying an exact search string, i.e. one string for
each IP address? You can imagine why I don't want to have to create a
CASE/ELSE for this scenario...

I'm open to any suggestions.
I presume you're guaranteed what the IP addresses are, and that they won't
ever change or be placed behind a NAT box or something that will change

the IP addresses? Or that the subnet setup won't change?

Why not identify machines with something like an X.509 certificate, which is _meant_ to be identifying? IP addresses aren't actually meant for that
purpose.

John Saunders

Nov 18 '05 #3
WJ
Impossible mission! How can you tell if it is fake IP or Ip generated by
dhcp ? It makes sense for intranet but not internet.

John

"tma" <tm*@allisconfusing.net> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
Actually, the IP addresses are from "people" who hit my website. Spiders
for
example. So while the address space is fairly constant, it still needs to
be
a range of addresses to test for.

Any thoughts?
"John Saunders" <jo**************@hotmail.com> wrote in message
news:uS*************@TK2MSFTNGP10.phx.gbl...
"tma" <tm*@allisconfusing.net> wrote in message
news:ed**************@TK2MSFTNGP11.phx.gbl...
>I am creating code that makes decisions based on the result of the
> Request.UserHostAddress. Is there a way I can search on /CIDR or range of > IP
> addresses without specifying an exact search string, i.e. one string
> for
> each IP address? You can imagine why I don't want to have to create a
> CASE/ELSE for this scenario...
>
> I'm open to any suggestions.


I presume you're guaranteed what the IP addresses are, and that they
won't
ever change or be placed behind a NAT box or something that will change

the
IP addresses? Or that the subnet setup won't change?

Why not identify machines with something like an X.509 certificate, which

is
_meant_ to be identifying? IP addresses aren't actually meant for that
purpose.

John Saunders


Nov 18 '05 #4
tma
I don't need to know if the IP address is "real", only that it falls within
a specified subnet.
"WJ" <Jo*******@HotMail.Com> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
Impossible mission! How can you tell if it is fake IP or Ip generated by
dhcp ? It makes sense for intranet but not internet.

John

"tma" <tm*@allisconfusing.net> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
Actually, the IP addresses are from "people" who hit my website. Spiders
for
example. So while the address space is fairly constant, it still needs to be
a range of addresses to test for.

Any thoughts?
"John Saunders" <jo**************@hotmail.com> wrote in message
news:uS*************@TK2MSFTNGP10.phx.gbl...
"tma" <tm*@allisconfusing.net> wrote in message
news:ed**************@TK2MSFTNGP11.phx.gbl...
>I am creating code that makes decisions based on the result of the
> Request.UserHostAddress. Is there a way I can search on /CIDR or range
of
> IP
> addresses without specifying an exact search string, i.e. one string
> for
> each IP address? You can imagine why I don't want to have to create
a > CASE/ELSE for this scenario...
>
> I'm open to any suggestions.

I presume you're guaranteed what the IP addresses are, and that they
won't
ever change or be placed behind a NAT box or something that will change

the
IP addresses? Or that the subnet setup won't change?

Why not identify machines with something like an X.509 certificate,

which is
_meant_ to be identifying? IP addresses aren't actually meant for that
purpose.

John Saunders



Nov 18 '05 #5
Maybe what I immediately think of is trivial, but Request.UserHostAddress
returns a string, so can you use regular expression to identify the subnet?

"tma" <tm*@allisconfusing.net> wrote in message
news:ul**************@TK2MSFTNGP14.phx.gbl...
I don't need to know if the IP address is "real", only that it falls within
a specified subnet.
"WJ" <Jo*******@HotMail.Com> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
Impossible mission! How can you tell if it is fake IP or Ip generated by
dhcp ? It makes sense for intranet but not internet.

John

"tma" <tm*@allisconfusing.net> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
> Actually, the IP addresses are from "people" who hit my website.
> Spiders
> for
> example. So while the address space is fairly constant, it still needs to > be
> a range of addresses to test for.
>
> Any thoughts?
>
>
> "John Saunders" <jo**************@hotmail.com> wrote in message
> news:uS*************@TK2MSFTNGP10.phx.gbl...
>> "tma" <tm*@allisconfusing.net> wrote in message
>> news:ed**************@TK2MSFTNGP11.phx.gbl...
>> >I am creating code that makes decisions based on the result of the
>> > Request.UserHostAddress. Is there a way I can search on /CIDR or range > of
>> > IP
>> > addresses without specifying an exact search string, i.e. one string
>> > for
>> > each IP address? You can imagine why I don't want to have to create a >> > CASE/ELSE for this scenario...
>> >
>> > I'm open to any suggestions.
>>
>> I presume you're guaranteed what the IP addresses are, and that they
>> won't
>> ever change or be placed behind a NAT box or something that will
>> change
> the
>> IP addresses? Or that the subnet setup won't change?
>>
>> Why not identify machines with something like an X.509 certificate, which > is
>> _meant_ to be identifying? IP addresses aren't actually meant for that
>> purpose.
>>
>> John Saunders
>>
>>
>
>



Nov 18 '05 #6

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

Similar topics

2
by: Tom | last post by:
Hi If I set a proxy in IE to view a view site. My IP is 223.12.98.244 and the proxy IP is 202.156.87.179 Can Request.UserHostAddress trace 223.12.98.244? I use C# If not, how can I trace...
2
by: TS | last post by:
I seem to remember reading somewhere that accessing this collection is expensive and you should avoid it if possible. Are there any alternatives to the following: Request.ServerVariables; ...
4
by: Ben Amada | last post by:
Hello! There are a couple of visitors (out of dozens) to this web page who are causing the following error to occur: "Object reference not set to an instance of an object." I'm actually...
1
by: robert rottermann via .NET 247 | last post by:
(Type your message here) -------------------------------- From: robert rottermann Hi everybody, is it possible to set the UserHostAddress when sending a request? Thanks for your time Robert
3
by: hn | last post by:
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.
2
by: Shimon Sim | last post by:
How to find out IP address of request? If I sent request via HttpWebRequest can I set IP or it is added automatically? Thanks, Shimon.
5
by: Brian Henry | last post by:
I want to be able to forward any request from my one site to another site based on the IP address... kind of like denying access to the site if an IP is a certain one if they try to access any page...
0
by: cbanks | last post by:
I have read the messages about (not) always obtaining the 'actual' ip address of the sender using Request.UserHostAddress. What I don't understand is why does the W3SVC1 show one ip address and...
9
by: Mark Rae | last post by:
Hi, Now that the VS.NET 2005 SP1 update patch is with us, I'm in the process of moving my main development environment onto 64-bit Vista Business Edition - so far, so good... However, there...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.