|
|
How to do this the reliable way, a very simple solution is to use the 'isLocal' property of the Request class as shown below:
C#
protected void Page_Load(object sender, EventArgs e)
{
if (HttpContext.Current.Request.IsLocal)
{
Response.Write("App is local");
}
}
VB.NET
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
If HttpContext.Current.Request.IsLocal Then
Response.Write("App is local")
End If
End Sub
'Like' us on our FaceBook page if you find this blog useful. Thanks!
Did you like this post?
|
|
|
||
|
|
|
|
Save on Delicious |
|
|
subscribe via rss |
|
subscribe via e-mail |
|
|
print this post |
|
follow me on twitter |




comments
1 Response to "How do you programmatically determine if an ASP.NET application is running locally"Verry good tip
Post a Comment