现在的位置: 首页 > 综合 > 正文

替换HTML代码

2013年12月05日 ⁄ 综合 ⁄ 共 457字 ⁄ 字号 评论关闭

将一些HTML替换掉

eg:
strContent=strContent.Replace("&","&amp");
strContent=strContent.Replace("'","''");
strContent=strContent.Replace("<","&lt");
strContent=strContent.Replace(">","&gt");
strContent=strContent.Replace("chr(60)","&lt");
strContent=strContent.Replace("chr(37)","&gt");
strContent=strContent.Replace("/"","&quot");
strContent=strContent.Replace(";",";");
strContent=strContent.Replace("/n","<br/>");
strContent=strContent.Replace(" ","&nbsp");
return strContent;

抱歉!评论已关闭.