请问ASP.NET 有像 mysql_real_escape_string 这样的类似的方法吗?C#版的不想要其它替代方法,只是想找这样的函数实现。mysql_real_escape_string
解决方案 »
- AjaxPanel刷新页面问题
- 谁做过BBSMAX论坛统一登陆数据也统一的整合
- asp.net困惑我已久的问题,能耐心回答的进
- 请教各位大人,关于vs2005下如何用框架frameset,2003下可以,2005下报错,我想实现页面的局部刷新,母版页masterPage可以实现局部刷新吗?
- 怎么调用Excel?在线等。马上给分
- smtp邮件发送的问题:高手请进
- fileupload 只能上传NTFS格式分区的文件 急,在线等 !!!
- asp.net 页面上动态创建imgage控件
- 我在w2k server安装了.net组件,.net framework 为什么访问.aspx网页是还是显示原码??
- 强引用类型生成的菜单,如何在其他控制器view页面使用?
- 谁能给小女子一个快速排序的演示程序~~谢谢谢谢了~~
- 实现即时图片显示的问题
/// 去除HTML标记
public static string NoHTML(string strHtml)
{
strHtml= Regex.Replace(strHtml, @"<script[^>]*?>.*?</script>", "", RegexOptions.IgnoreCase); strHtml= Regex.Replace(strHtml, @"<(.[^>]*)>", "", RegexOptions.IgnoreCase);
strHtml= Regex.Replace(strHtml, @"([\r\n])[\s]+", "", RegexOptions.IgnoreCase);
strHtml= Regex.Replace(strHtml, @"-->", "", RegexOptions.IgnoreCase);
strHtml= Regex.Replace(strHtml, @"<!--.*", "", RegexOptions.IgnoreCase); strHtml= Regex.Replace(strHtml, @"&(quot|#34);", "\"", RegexOptions.IgnoreCase);
strHtml= Regex.Replace(strHtml, @"&(amp|#38);", "&", RegexOptions.IgnoreCase);
strHtml= Regex.Replace(strHtml, @"&(lt|#60);", "<", RegexOptions.IgnoreCase);
strHtml= Regex.Replace(strHtml, @"&(gt|#62);", ">", RegexOptions.IgnoreCase);
strHtml= Regex.Replace(strHtml, @"&(nbsp|#160);", " ", RegexOptions.IgnoreCase);
strHtml= Regex.Replace(strHtml, @"&(iexcl|#161);", "\xa1", RegexOptions.IgnoreCase);
strHtml= Regex.Replace(strHtml, @"&(cent|#162);", "\xa2", RegexOptions.IgnoreCase);
strHtml= Regex.Replace(strHtml, @"&(pound|#163);", "\xa3", RegexOptions.IgnoreCase);
strHtml= Regex.Replace(strHtml, @"&(copy|#169);", "\xa9", RegexOptions.IgnoreCase);
strHtml= Regex.Replace(strHtml, @"&#(\d+);", "", RegexOptions.IgnoreCase); strHtml.Replace("<", "");
strHtml.Replace(">", "");
strHtml.Replace("\r\n", "");
strHtml= HttpContext.Current.Server.HtmlEncode(strHtml).Trim(); return strHtml;
}