Solved

Determine if Running App From Local or ISP Host

Posted on 2013-06-16
2
416 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
2 Comments
 
LVL 78

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
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…

743 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now