2020国产成人精品视频,性做久久久久久久久,亚洲国产成人久久综合一区,亚洲影院天堂中文av色

分享

此方法用于確認(rèn)用戶輸入的不是惡意信息 - 平常的心,對(duì)待平常的事 - 博客園

 xnet 2007-01-17
參照petshop 4.0
/// <summary>
        /// 此方法用于確認(rèn)用戶輸入的不是惡意信息
        /// </summary>
        /// <param name="text">用戶輸入信息</param>
        /// <param name="maxLength">輸入的最大長(zhǎng)度</param>
        /// <returns>處理后的輸入信息</returns>
        public static string InputText(string text, int maxLength) {
            text = text.Trim();
            if (string.IsNullOrEmpty(text))
                return string.Empty;
            if (text.Length > maxLength)
                text = text.Substring(0, maxLength);
            //將網(wǎng)頁(yè)中非法和有攻擊性的符號(hào)替換掉,以防sql注入!返回正常數(shù)據(jù)
            text = Regex.Replace(text, "[\\s]{2,}", " "); // 2個(gè)或以上的空格
            text = Regex.Replace(text, "(<[b|B][r|R]/*>)+|(<[p|P](.|\\n)*?>)", "\n"); //<br> html換行符
            text = Regex.Replace(text, "(\\s*&[n|N][b|B][s|S][p|P];\\s*)+", " "); //    html空格符
            text = Regex.Replace(text, "<(.|\\n)*?>", string.Empty); // 任何其他的標(biāo)簽
            text = text.Replace("‘", "‘‘");// 單引號(hào)
            return text;
        }

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購(gòu)買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約