Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / May 2007

Tip: Looking for answers? Try searching our database.

determine local access

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Frank - 07 May 2007 14:57 GMT
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
Alberto Poblacion - 07 May 2007 15:19 GMT
> 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.
Michael Nemtsev - 07 May 2007 15:52 GMT
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> "Frank" <franknews@advitronic.nl> wrote in message
AP> news:133uc2ceebjpq5c@corp.supernews.com...
AP>
>> 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).

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>
Alberto Poblacion - 07 May 2007 16:14 GMT
> 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.
Frank - 07 May 2007 16:00 GMT
Thanks Alberto,
looks like a good solution.
Frank
>> 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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.