當前位置:開發者網絡 >> 技術教程 >> .NET教程 >> 面向對像編程 >> 內容
精彩推薦
分類最新教程
分類熱點教程
    
替換HTML代碼
作者:未知
日期:2004-10-27
人氣:
投稿:snow(轉貼)
來源:未知
字體:
收藏:加入瀏覽器收藏
以下正文:
將一些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;



相關文章: