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. Advertisements

  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. Advertisements

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. karim
    Replies:
    1
    Views:
    925
    George Ter-Saakov
    Jun 26, 2003
  2. Brian Birtle
    Replies:
    2
    Views:
    2,615
    John Saunders
    Oct 16, 2003
  3. Jim in Arizona
    Replies:
    8
    Views:
    5,238
    Jim in Arizona
    Jan 24, 2006
  4. John Salerno
    Replies:
    10
    Views:
    906
    Steve Holden
    Sep 30, 2006
  5. Replies:
    8
    Views:
    2,775
    Tom Anderson
    Nov 24, 2008
  6. shanti bhushan
    Replies:
    1
    Views:
    764
    Gabriel Genellina
    Jun 15, 2010
  7. 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:
    370
    Robert Koritnik
    Oct 11, 2004
  8. delu
    Replies:
    1
    Views:
    201
    Ray Costanzo [MVP]
    Oct 1, 2004
Loading...