Esempio n. 1
0
 /// <summary>
 /// 取消指定主机的屏蔽
 /// </summary>
 /// <param name="ip"></param>
 public void UnBanIP(IPAddress ip)
 {
     if (BanedHost != null && BanedHost.Contains(ip.ToString()))
     {
         BanedHost.Remove(ip.ToString());
     }
 }
Esempio n. 2
0
 /// <summary>
 /// 加入一个主机到黑名单
 /// </summary>
 /// <param name="ip"></param>
 public void BanHost(IPAddress ip)
 {
     if (BanedHost == null)
     {
         BanedHost = new List <string>();
     }
     if (!BanedHost.Contains(ip.ToString()))
     {
         BanedHost.Add(ip.ToString());
     }
 }
Esempio n. 3
0
 /// <summary>
 /// 检测一个主机是否在黑名单中
 /// </summary>
 /// <param name="ip"></param>
 /// <returns></returns>
 public bool IsHostInBlockList(IPAddress ip)
 {
     return(BanedHost != null && BanedHost.Contains(ip.ToString()));
 }