"Husam" <Hu***@discussions.microsoft.comwrote in message
news:77**********************************@microsof t.com...
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.CompleteRe quest();
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...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net