Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Redirect based on ip address 2

Status
Not open for further replies.

craigosa6033

Technical User
Sep 12, 2005
10
US
I'm trying to redirect to a page based on the client's ip address. I have a range, and I guess I would create a redirect in Sub Page_Load, how do I call up the client's ip address as a variable?

thanks.
 
The IP looks like: x1.x2.x3.x4

Dim a() As String = Request.UserHostAddress.Split(".")
So a(0),a(1),a(2) and a(3) contain as string x1 to x4

If you want the whole IP to i.e use a RegExp then
Dim a As String = Request.UserHostAddress
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top