Example #1
0
        public static List <string> GetAllBannedIPs()
        {
            var bannedIPAddressList = new List <string>();

            using (IDataReader reader = DBBannedIP.GetAll())
            {
                while (reader.Read())
                {
                    bannedIPAddressList.Add(reader["BannedIP"].ToString());
                }
            }

            return(bannedIPAddressList);
        }
Example #2
0
        /// <summary>
        /// Gets an IList with all instances of BannedIPAddress.
        /// </summary>
        public static List <BannedIPAddress> GetAll()
        {
            List <BannedIPAddress> bannedIPAddressList
                = new List <BannedIPAddress>();

            using (IDataReader reader = DBBannedIP.GetAll())
            {
                while (reader.Read())
                {
                    BannedIPAddress bannedIPAddress = new BannedIPAddress();
                    bannedIPAddress.rowID        = Convert.ToInt32(reader["RowID"]);
                    bannedIPAddress.bannedIP     = reader["BannedIP"].ToString();
                    bannedIPAddress.bannedUTC    = Convert.ToDateTime(reader["BannedUTC"]);
                    bannedIPAddress.bannedReason = reader["BannedReason"].ToString();
                    bannedIPAddressList.Add(bannedIPAddress);
                }
            }

            return(bannedIPAddressList);
        }