How to detect when request from local computer (server)

Discussion in 'ASP .Net' started by Rafael Leonhardt, Mar 2, 2005.

  1. How I can to detect when a user access a site from the server?
    I need to control someting like "remoteonly" on custom errors in my aspx to
    show some information when local and other wen remote.
     
    Rafael Leonhardt, Mar 2, 2005
    #1
    1. Advertising

  2. Rafael Leonhardt

    szeying.tan Guest

    use Request.ServerVariables;
    and retrieve the HTTP_HOST server variable.
    if it is localhost, then the use is accessing the site from the server.

    syntax would be like so:
    Request.ServerVariables["HTTP_HOST"];
     
    szeying.tan, Mar 2, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brian Birtle
    Replies:
    2
    Views:
    2,058
    John Saunders
    Oct 16, 2003
  2. John Salerno
    Replies:
    10
    Views:
    744
    Steve Holden
    Sep 30, 2006
  3. Replies:
    8
    Views:
    2,533
    Tom Anderson
    Nov 24, 2008
  4. Lionel Neo

    Display html on another computer instead of local computer

    Lionel Neo, Oct 11, 2004, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    234
    Robert Koritnik
    Oct 11, 2004
  5. delu
    Replies:
    1
    Views:
    112
    Ray Costanzo [MVP]
    Oct 1, 2004
Loading...

Share This Page