惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

J
Java Code Geeks
GbyAI
GbyAI
Google DeepMind News
Google DeepMind News
Jina AI
Jina AI
B
Blog
aimingoo的专栏
aimingoo的专栏
酷 壳 – CoolShell
酷 壳 – CoolShell
T
The Blog of Author Tim Ferriss
Last Week in AI
Last Week in AI
月光博客
月光博客
H
Help Net Security
V
Visual Studio Blog
量子位
A
About on SuperTechFans
博客园 - Franky
人人都是产品经理
人人都是产品经理
N
Netflix TechBlog - Medium
云风的 BLOG
云风的 BLOG
雷峰网
雷峰网
Martin Fowler
Martin Fowler
Microsoft Security Blog
Microsoft Security Blog
博客园 - 叶小钗
P
Proofpoint News Feed
MongoDB | Blog
MongoDB | Blog

博客园 - 风语战士

asp.net 命名规范 CSS 色彩值... 请问 CType和DirectCast函数有何区别 soundex RadMenu菜单的父节指定image - 风语战士 - 博客园 从数据库中存取二进制数据并显示 - 风语战士 - 博客园 vs2005 web.config大全 javascript中showModalDialog和showModelessDialog的使用 设为主页 - 风语战士 - 博客园 CSS样式表 截取字付串 表达是做为参数验证用 DataList翻页 引用一个falsh使它显示出来 删除成功后.添加前.可判断 弹出另一页面 (转)VS2005(c#)项目调试问题解决方案集锦 常用正则表达式 在ASP.NET中使用Session常见问题集锦
.net安全防止写不规范字付
风语战士 · 2007-12-20 · via 博客园 - 风语战士

输入时
public string TransString(string str)
  {
   short temp=13;
   str=str.Replace("'","’");
   str=str.Replace("&","&");
   str=str.Replace("<","&lt;");
   str=str.Replace(">","&gt;");
   str=str.Replace(" ","&nbsp;");
   str=str.Replace(((char)temp).ToString(),"<br>");
   return str;
  }
读取时.
  public string BackTransString(string str)
  {
   short temp=13;
   str=str.Replace("’","'");
   str=str.Replace("&amp;","&");
   str=str.Replace("&lt;","<");
   str=str.Replace("&gt;",">");
   str=str.Replace("&nbsp;"," ");
   str=str.Replace("<br>",((char)temp).ToString());
   return str;
  }

posted on 2007-12-20 20:34  风语战士  阅读(214)  评论()    收藏  举报