Skip to main content
Home Forums General Silverlight New Features in Silverlight 3 Validate Local Access using Network Interface
2 replies. Latest Post by FuryDiamond on July 7, 2009.
(0)
FuryDiamond
Contributor
3870 points
766 Posts
07-07-2009 11:53 AM |
Is there a way to determine whether the application is being run on a local computer vs a remote server (either localhost via Visual Studio or uploaded online)?
I tried using the NetworkInterface.GetIsNetworkAvailable call, but it is always run because it can connect to the internet.
ccoombs
5168 points
758 Posts
07-07-2009 12:37 PM |
Browser.HtmlPage.Document.DocumentUri.ToString().StartsWith("http://localhost") ?
i'm not sure if there's really an 'official' way.
07-07-2009 12:56 PM |
Thanks ccoombs!
Browser.HtmlPage.Document.DocumentUri.ToString().StartsWith("http://") worked perfectly because it compares for localhost (visual studio) and as well as online sites (http://www.domain.com).