All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
使用PHP的Socket写的POP3类_[PHP教程]
PHP将汉字转换拼音_[PHP教程]
ASP.NET从零起步设计网站全过程(1)_[Asp.Net教程]
C#教程:线程的优先权
ASP.NET,2.0高级数据处理之主从数据表_.net资料_编程技术
调用VS数据源实现数据库连接字符串配置_[Asp.Net教程]
C#中while语句的用法实例详解
在GridView中显示图片_[Asp.Net教程]
javascript+XML,操作_JavaScript技术_编程技术
在global.asax中实现URL重写(应用)_[Asp.Net教程]
Reading number is top 10 pictures
Absolutely shocked. National geographic 50 animal photographys5
29 the belle stars after bath figure1
From China fortress sora aoi3
男人帮杂志里的惹火性感美女2
俄罗斯台球天后惊艳魅惑2
On the verge of extinction of the beach1
2012 national geographic daily picture2
9.3阅兵全景图4-陸海空现代化兵种方阵梯队
奇趣的世界记录3
Absolutely shocked. National geographic 50 animal photographys3
Download software ranking
Eclipse-CALMSANNY (second edition)
Take off clothes to survival
Boxer vs Yellow5
c#程序设计案例教程
传奇私服架设教程-chm
软件工程思想
塘西风月痕
Twenty piece of palm leaf
Unix video tutorial17
在线棋牌游戏3.05版
delv published in(发表于) 2014/1/10 6:32:17 Edit(编辑)
此方法用于确认用户输入的不是恶意信息_[Asp.Net教程]

此方法用于确认用户输入的不是恶意信息_[Asp.Net教程]

此方法用于确认用户输入的不是恶意信息_[Asp.Net教程]

参照petshop 4.0
///


/// 此方法用于确认用户输入的不是恶意信息
///

/// 用户输入信息
/// 输入的最大长度
/// 处理后的输入信息
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);
//将网页中非法和有攻击性的符号替换掉,以防sql注入!返回正常数据
text = Regex.Replace(text, "[\\s]{2,}", " "); // 2个或以上的空格
text = Regex.Replace(text, "(<[b|B][r|R]/*>)+|(<[p|P](.|\\n)*?>)", "\n"); //
html换行符
text = Regex.Replace(text, "(\\s*&[n|N][b|B][s|S][p|P];\\s*)+", " "); //&nbsp; html空格符
text = Regex.Replace(text, "<(.|\\n)*?>", string.Empty); // 任何其他的标签
text = text.Replace("'", "''");// 单引号
return text;
}



http://www.cnblogs.com/wang123/archive/2007/01/16/622035.html







添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.