Solved

Determine if Running App From Local or ISP Host

Posted on 2013-06-16
2
427 Views
Last Modified: 2013-06-16
I need code to determine if my app is running on the ISP Host

When on local host the address text is "http://localhost:51821/MyPage.aspx"

On the ISP host the address is "http://www.MyDomainName.com/"

I need something like the following:

if(localhost)
  {
        Do Something  
   }

else

{

        Do Something else
}

Thanks,
0
Comment
Question by:Dovberman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 82

Accepted Solution

by:
David Johnson, CD, MVP earned 300 total points
ID: 39251919
use the Response.Write(Request.ServerVariables["LOCAL_ADDR"]);

i.e.
 <p><b>You are browsing this site with:</b>
<%Response.Write(Request.ServerVariables("LOCAL_ADDR"))%>
</p>

Use the results from the request to do your checking.
0
 

Author Closing Comment

by:Dovberman
ID: 39252272
That worked.

Thanks
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

626 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question