Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Determine if Running App From Local or ISP Host

Posted on 2013-06-16
2
Medium Priority
?
430 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 84

Accepted Solution

by:
David Johnson, CD, MVP earned 1200 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
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…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

916 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