"Husam" <Hu***@discussi ons.microsoft.c omwrote in message
news:77******** *************** ***********@mic rosoft.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_Beg inRequest(objec t sender, EventArgs e)
{
if (HttpContext.Cu rrent.Request.S erverVariables["REMOTE_ADD R"] ==
10.0.0.17)
{
HttpContext.Cur rent.Response.S tatusCode = 404;
HttpContext.Cur rent.Response.S uppressContent = true;
HttpContext.Cur rent.Applicatio nInstance.Compl eteRequest();
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