替换HTML代码

类别:.NET开发 点击:0 评论:0 推荐:

将一些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;

 

本文地址:http://com.8s8s.com/it/it43334.htm