Is ASP.NET App Being Accessed Internally/Externally

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi.

In VB.NET, is it possible to determine whether an ASP.NET is being accessed
internally (within the same domain hosting the application) or externally
(across the internet)? I've looked at using the HttpRequest.ServerVariables
Property, but it doesn't look like it's NameValueCollection contains any
items which would identify whether or not a program is being accessed
internally/externally.

Basically I need to apply certain logic when a program is accessed
internally (within my company) and different logic when a program is accessed
externally (across the internet).

Is this possible?

Thanks.
 
The only thing that comes to mind is attempting to filter based upon IP
address. The username property I've found doesn't always show the name of a
domain user so that isn't always reliable. The server itself knows nothing
about where the client request is coming from other than the IP address and
it has no way of knowing if it's in your network or not. You could parse the
IP address and check if it's within the range of your network. If you create
a filter or range, you may consider not hard-coding it and placing the data
in the web.config so you can quickly adapt if the network grows/shrinks.
 
Back
Top