Class IpBanner
- Namespace
- Dynamicweb.System
Tools .Security
- Assembly
- Dynamicweb.dll
Handling banning of IP's
- Inheritance
-
Ip
Banner
- Inherited Members
Methods
BanIp(string, DateTime)
Bans the specified IP for till the specified expiration time.
Parameters
BanIp(string, DateTime, string)
Bans the specified IP for till the specified expiration time.
Parameters
ip
stringThe ip to ban. Use Get
Client to handle forward IPsIpAddress() banExpiration
DateTime The ban expiration datetime.
cause
string
BanIp(string, string)
Parameters
GetClientIpAddress()
Gets the client ip address either from X_FORWARDED_FOR or X-CLIENT-IP header or UserHostAddress of the request.
Returns
- string
An ip address. If X_FORWARDED_FOR or X-CLIENT-IP header contains a value of more IPs, the string is analyzed from the right and returns the first instance that is not a private IP (192.168./10./172.16.-172.32./169.254.*)
IsBanned(string)
Determines whether the specified ip is banned.
Parameters
ip
stringThe ip.
Returns
- bool
true
if the specified ip is banned; otherwise,false
.
IsPrivateIpAddress(string)
Parameters
ipAddress1
string
Returns
IsWhitelistIpAddress(string)
Parameters
ipAddress1
string