愤怒!你再把你家电话发上来试试

//屏蔽你家电话一百年!换数字符号咋啦?符号就搞不定你?小样儿~~~~~~~~~~
private Boolean Prohibited(String input)
{
    StringBuilder sb = new StringBuilder(32);
    String str = input.Replace('O', '0');    //把大写字母O换成数字0,我丁学就不信你还能怎么着

    foreach(char c in str.ToCharArray())
    {
        if(c >= '0' && c <= '9')
        {
            sb.Append(c);
        }
        else if(c >= '0' && c <= '9')
        {
            sb.Append(c - '0');
        }
        else if(c >= '⒈' && c <= '⒛')
        {
            sb.Append(c - '⒈' + 1);
        }
        else if(c >= '①' && c <= '⑩')
        {
            sb.Append(c - '①' + 1);
        }
        else if(c >= '㈠' && c <= '㈩')
        {
            sb.Append(c - '㈠' + 1);
        }
        else if(c >= '⑴' && c <= '⒇')
        {
            sb.Append(c - '⑴' + 1);
        }
    }
    str = sb.ToString();


    using(ProhibitedAdapter ada = new ProhibitedAdapter())
    {
        ProhibitedDataTable prohibited = ada.GetProhibitedList();
        foreach(ProhibitedRow row in prohibited.Rows)
        {
            if(str.Contains(row.Keyword))
            {
                return false;
            }
        }
    }

    return true;
}
posted @ 2007-08-08 09:04  丁学  阅读(3505)  评论(9编辑  收藏  举报