Control Certain IP

G

Guest

Hi EveryBody:

My question Is how can I control or track any Ip of computer and prevent it
from entering web site either by domain name or ite IP address

For example:

If my computer IP is 10.0.0.117 and Domain name for site is www.yahoo.com
and its relevent IP address id for example 84.34.55.213 how can I control the
first IP to not enter a second IP ?

is there any way to do so...

any help will be or redirection will be appreciated

regard's

Husam
 
M

Mark Rae [MVP]

My question Is how can I control or track any Ip of computer and prevent
it
from entering web site either by domain name or ite IP address

For example:

If my computer IP is 10.0.0.117 and Domain name for site is www.yahoo.com
and its relevent IP address id for example 84.34.55.213 how can I control
the
first IP to not enter a second IP ?

is there any way to do so...

any help will be or redirection will be appreciated

Firstly, you've posted in an ASP.NET newsgroup, so I presume you're asking
about how to prevent a computer with a certain IP address from entering a
site which you are developing - you certainly can't prevent a computer from
navigating away from your site and going to www.yahoo.com, at least, not
through ASP.NET...

You could do something like this in Global.asax:

void Application_BeginRequest(object sender, EventArgs e)
{
if (HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"] ==
10.0.0.17)
{
HttpContext.Current.Response.StatusCode = 404;
HttpContext.Current.Response.SuppressContent = true;
HttpContext.Current.ApplicationInstance.CompleteRequest();
return;
}
}

This might be OK for a closed intranet application, but would be no use at
all for the live Internet because it's so easy to spoof an IP address...
 
A

Alexey Smirnov

My question Is how can I control or track any Ip of computer and prevent
it
from entering web site either by domain name or ite IP address
For example:
If my computer IP is 10.0.0.117 and Domain name for site iswww.yahoo.com
and its relevent IP address id for example 84.34.55.213 how can I control
the
first IP to not enter a second IP ?
is there any way to do so...
any help will be or redirection will be appreciated

Firstly, you've posted in an ASP.NET newsgroup, so I presume you're asking
about how to prevent a computer with a certain IP address from entering a
site which you are developing - you certainly can't prevent a computer from
navigating away from your site and going towww.yahoo.com, at least, not
through ASP.NET...

You could do something like this in Global.asax:

void Application_BeginRequest(object sender, EventArgs e)
{
if (HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"] ==
10.0.0.17)
{
HttpContext.Current.Response.StatusCode = 404;
HttpContext.Current.Response.SuppressContent = true;
HttpContext.Current.ApplicationInstance.CompleteRequest();
return;
}

}

This might be OK for a closed intranet application, but would be no use at
all for the live Internet because it's so easy to spoof an IP address...

Husam,

in addition, you can also block an IP address in IIS
http://www.hostmysite.com/support/dedicated/IIS/blockip/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top