替换HTML代码

 将一些HTML替换掉

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;

posted @ 2007-01-09 13:04  '.Elvis.'  阅读(207)  评论(0编辑  收藏  举报