Is ASP.NET App Being Accessed Internally/Externally

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.
 
M

Mark Fitzpatrick

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top