Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. IIS Server Variables

IIS Server Variables

Scheduled Pinned Locked Moved ASP.NET
questionsysadminwindows-admin
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    tdciDoug
    wrote on last edited by
    #1

    SERVER_NAME "Returns the server's host name, DNS alias, or IP address as it would appear in self-referencing URLs" I have used this, and all I ever get is the host name. How do I return the IP address of the host using this option?? Have a wonderful evening Doug Wright Developer, TDCI

    A M 2 Replies Last reply
    0
    • T tdciDoug

      SERVER_NAME "Returns the server's host name, DNS alias, or IP address as it would appear in self-referencing URLs" I have used this, and all I ever get is the host name. How do I return the IP address of the host using this option?? Have a wonderful evening Doug Wright Developer, TDCI

      A Offline
      A Offline
      Alvaro Mendez
      wrote on last edited by
      #2

      REMOTE_ADDR Regards, Alvaro


      You know what they say about arguing over the Internet...

      T 1 Reply Last reply
      0
      • A Alvaro Mendez

        REMOTE_ADDR Regards, Alvaro


        You know what they say about arguing over the Internet...

        T Offline
        T Offline
        tdciDoug
        wrote on last edited by
        #3

        Doesn't REMOTE_ADDR give you the IP of the user? I want the IP of the actual server that is hosting the website. Have a wonderful evening Doug Wright Developer, TDCI

        1 Reply Last reply
        0
        • T tdciDoug

          SERVER_NAME "Returns the server's host name, DNS alias, or IP address as it would appear in self-referencing URLs" I have used this, and all I ever get is the host name. How do I return the IP address of the host using this option?? Have a wonderful evening Doug Wright Developer, TDCI

          M Offline
          M Offline
          minhpc_bk
          wrote on last edited by
          #4

          Hi there, With the SERVER_NAME variable, you only receive the IP address of the host when it appears the URL, instead you can use the LOCAL_ADDR variable. To quickly view the values of all server variables you can simply set the Trace="True" in the Page directive in your web page, and launch that page in your browser then see the Server Variables section. In addition, you can get the IP of the host in code with the Dns class defined the System.Net namespace. For more information see Dns Class[^]

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups