Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Determine if Running App From Local or ISP Host

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

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

Congratulations! You’re Certified – Now What?

Starting a new career can be overwhelming. Becoming certified in your field of expertise is a great start, but where do you go from here?  Here are some tips to help you on your career journey.

Question has a verified solution.

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

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
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…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

721 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