Deny by IP

From: Tony Schlak (tony_at_optics.arizona.edu)
Date: 03/31/04


Date: Tue, 30 Mar 2004 15:14:44 -0700

I want to able to deny people viewing certain aspects of my website. IE
people's home phone numbers and address. Currently under ASP in the
global.asa I have a subroutine that looks to see whether the user is local
(w/in a certain IP range) or not local. IF they fall with the range they
see everything on the page, if they don't they get a message saying that
they are viewing the info outside of our IP range. How do I convert the
subroutine into ASPX global.asax. Here is the subroutine:

Currently in my Global.asa

Sub CheckLocal
 strSubNet = Left( Request.ServerVariables("REMOTE_ADDR"), 11 )
 If strSubNet = "xxx.xxx.xxx" or strSubNet = "xxx.xxx.xxx" or strSubNet =
"xxx.xxx.xxx" or strSubNet = "128.196.110" or strSubNet = "xxx.xxx.xxx" or
strSubNet = "xxx.xxx.xxx" Then
  Session("bLocal") = 1
 Else
  Session("bLocal") = 0
  End If
End Sub

Thanks,
Tony



Relevant Pages