Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
Block more than one IP address
Author:
barış
E-mail:
Click to e-mail author
Website:
http://www.happycodings.com
Submitted:
1/10/2014
Version:
ASP
Compatibility:
ASP3.0
Category:
ASP
Views:
6486
Block more than one IP address.
Declarations:
'none
Code:
Block more than one IP address <% 'declare our variables Dim strIP Dim intBanned Dim arrIP(1) 'these are our blocked IP addresses arrIP(0) = "127.0.0.01" arrIP(1) = "100.45.76.80" 'get the users IP address strIP = Request.ServerVariables("LOCAL_ADDR") intBanned = 1 'loop through the banned IP addresses For i = 0 to intBanned 'display a message and stop processing the page If strIP = arrIP(intBanned) Then Response.Write "You are blocked from this site" Response.End End If Next 'a welcome message if IP is OK response.Wr
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement