码迷,mamicode.com
首页 > Windows程序 > 详细

js和C#中的编码和解码(备忘)

时间:2014-12-05 00:39:55      阅读:434      评论:0      收藏:0      [点我收藏+]

标签:blog   http   sp   on   div   log   bs   html   as   

同一个字符串,用URL编码和HTML编码,结果是完全不同的。

JS中的URL编码和解码

encodeURIComponent("text") //url编码
decodeURIComponent("text") //url解码

JS中的HTML编码和解码

escape("text") //html编码
unescape("text") //html解码

 C#中的URL编码和解码

HttpUtility.UrlDecode("text") //url编码
HttpUtility.UrlEncode("text") //url解码

 C#中的HTML编码和解码

HttpUtility.HtmlDecode("text") //html编码
HttpUtility.HtmlEncode("text") //html解码

js和C#中的编码和解码(备忘)

标签:blog   http   sp   on   div   log   bs   html   as   

原文地址:http://www.cnblogs.com/ajunForNet/p/4145278.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!