Getting banned IP data

  Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic! Mail us feedback on this topic!  

The following sample code shows how you can get a banned IP as a BannedIPInfo object:

 

[C#]

 

using CMS.SiteProvider;

 

...

 

        // Get BannedIP object by IPAddressID

        BannedIPInfo bi = BannedIPInfoProvider.GetBannedIPInfo(1);

 

The following sample code shows how you can get a DataSet containing all banned IPs in the system with an IPAddressID greater than 5, ordered by their IPAddress:

 

[C#]

 

using System.Data;

using CMS.SiteProvider;

 

...

 

        string where = "IPAddressID > 5";

        string orderBy = "IPAddress";

 

        // Get DataSet of BannedIP objects

        DataSet ds = BannedIPInfoProvider.GetBannedIPs(where, orderBy);

 

Page url: http://devnet.kentico.com/docs/5_5r2/devguide/index.html?api_getting_banned_ip_data.htm