当前位置: 代码迷 >> ASP.NET >> 关于字符串过滤有关问题
  详细解决方案

关于字符串过滤有关问题

热度:6368   发布时间:2013-02-26 00:00:00.0
关于字符串过滤问题?
string   aa   =   " < ' < < < < ' < < < < < ' < < < < < < < < < < < < < < < < < < < ";
                aa.Replace( " < ",   "aaa ");
                Response.Write(aa);

我这样写怎么过滤不掉的??
还有我想把一段Html   写入数据库应该怎么做比较好?
    menu   =   ") '   background= 'images/title.gif '   style= 'cursor:hand '> ";
这样总是提示有单引号?
却过滤不掉!
解决马上给分!

------解决方案--------------------------------------------------------
string aa = " < ' < < < < ' < < < < < ' < < < < < < < < < < < < < < < < < < < ";
aa = aa.Replace( " < ", "aaa ");
Response.Write(aa);
------解决方案--------------------------------------------------------
string aa = " < ' < < < < ' < < < < < ' < < < < < < < < < < < < < < < < < < < "; aa =aa.Replace( " < ", "aaa "); Response.Write(aa); 要取返回值。
  相关解决方案