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. Get server name web app is running on

Get server name web app is running on

Scheduled Pinned Locked Moved ASP.NET
sysadminwindows-adminquestion
3 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.
  • D Offline
    D Offline
    dratcha
    wrote on last edited by
    #1

    Hi, I was wondering if there was an easy way to get the server name that a website is running on so it can be displayed on the page. I can pull the server name from the registry, but am not sure if that is really the best way to do it. Is there something nice and simple out there, kind of like an equivalent to request.servervariables? Thanks.

    J A 2 Replies Last reply
    0
    • D dratcha

      Hi, I was wondering if there was an easy way to get the server name that a website is running on so it can be displayed on the page. I can pull the server name from the registry, but am not sure if that is really the best way to do it. Is there something nice and simple out there, kind of like an equivalent to request.servervariables? Thanks.

      J Offline
      J Offline
      Jon Sagara
      wrote on last edited by
      #2

      Request.ServerVariables["SERVER_NAME"]? Request.ServerVariables["HTTP_HOST"]?

      Jon Sagara I said NO salt, NO salt on my margarita!!
      My Articles

      1 Reply Last reply
      0
      • D dratcha

        Hi, I was wondering if there was an easy way to get the server name that a website is running on so it can be displayed on the page. I can pull the server name from the registry, but am not sure if that is really the best way to do it. Is there something nice and simple out there, kind of like an equivalent to request.servervariables? Thanks.

        A Offline
        A Offline
        Albert Pascual
        wrote on last edited by
        #3

        System.Diagnostics.Process prcCurrent = System.Diagnostics.Process.GetCurrentProcess(); string sMachineName = prcCurrent.MachineName;

        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