Search code examples
c#asp.netintranet

Asp.net check if I'm on the intranet?


Is there any known way for asp.net to check if it runs on Intranet?

Edit

I need to show in my asp.net web page that the user runs in an intranet environment.

http://mysite/default.aspx

How can Default.aspx.cs tell me if he's running on intranet environment or in internet environment ?


Solution

  • You can check when someone ask your server if the IP is in a private IP class : 10.0.0.0/8 172.16.0.0/12 or 192.168.0.0/16. You can also add params in your configuration for intranet deployement (if you have multiple deployement).