public static bool IsIPDenyOrAllow(IList <IPStrategyInfo> listSource, string strLocalIP, IPStrategyType enuStrategyType) { bool result = false; foreach (IPStrategyInfo current in listSource) { if (current.Strategy == enuStrategyType.ToString()) { if (current.IPAddress.IndexOf("-") != -1) { string strBeginIP = current.IPAddress.Split(new char[] { '-' })[0]; string strEndIP = current.IPAddress.Split(new char[] { '-' })[1]; if (IPUtils.IsInIPDuan(strLocalIP, strBeginIP, strEndIP)) { result = true; break; } } else if (current.IPAddress == strLocalIP) { result = true; break; } } } return(result); }