Get server name web app is running on
-
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.
-
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.
Request.ServerVariables["SERVER_NAME"]
?Request.ServerVariables["HTTP_HOST"]
?Jon Sagara I said NO salt, NO salt on my margarita!!
My Articles -
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.
System.Diagnostics.Process prcCurrent = System.Diagnostics.Process.GetCurrentProcess(); string sMachineName = prcCurrent.MachineName;