determine local access

  • Thread starter Thread starter Frank
  • Start date Start date
F

Frank

Hello,
is there a way to determine someone is locally accessing the webpages
(localhost\index.aspx) in an ASP.NET environment? As opposed to from a
remote place (ie. 555.123.3.45\index.aspx).

Thank you
Frank
 
Frank said:
is there a way to determine someone is locally accessing the webpages
(localhost\index.aspx) in an ASP.NET environment? As opposed to from a
remote place (ie. 555.123.3.45\index.aspx).

You can examine Request.UserHostAddress which will be set to 127.0.0.1 if
the page is accessed from the localhost.
 
Hello Alberto,

The neat way is to use "HttpContext.Request.IsLocal", it incapsulate checks
for the 127.0.0.1

---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

AP> AP>AP> You can examine Request.UserHostAddress which will be set to
AP> 127.0.0.1 if the page is accessed from the localhost.
AP>
 
Thanks Alberto,
looks like a good solution.
Frank
Alberto Poblacion said:
You can examine Request.UserHostAddress which will be set to 127.0.0.1
if the page is accessed from the localhost.
 
Michael Nemtsev said:
Hello Alberto,

The neat way is to use "HttpContext.Request.IsLocal", it incapsulate
checks for the 127.0.0.1

Thanks, I didn't know that one.
 

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

Back
Top