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

JS加密对应的c#解码

时间:2018-08-16 11:25:16      阅读:208      评论:0      收藏:0      [点我收藏+]

标签:lin   字符   col   ati   nes   urlencode   web   编码   through   

 

escape不编码字符有69个:*,+,-,.,/,@,_,0-9,a-z,A-Z

encodeURI不编码字符有82个:!,#,$,&,‘,(,),*,+,,,-,.,/,:,;,=,?,@,_,~,0-9,a-z,A-Z

encodeURIComponent不编码字符有71个:!, ‘,(,),*,-,.,_,~,0-9,a-z,A-Z

1.

JS: escape : 解码使用:unescape

C#:HttpUtility.UrlEncode 解码使用: HttpUtility.UrlDecode

2.

JS: encodeURI :解码使用decodeURI();

C#: decodeURIComponent

3.

JS: encodeURIComponent  解码使用:decodeURIComponent()

C#:[HttpContext.Current.]Server.UrlDecode 解码使用: [HttpContext.Current.]Server.UrlEncode 

 

其实Escape,encodeURI,encodeURIComponent .其实都可以用HttpUtility.UrlDecode或者Server.UrlDecode 解码效果是一样的。

唯一区别看就是 HttpUtility.UrlDecode默认是utf8编码,Server.UrlDecode是根据webconfig配置的默认编码去解密的。

JS加密对应的c#解码

标签:lin   字符   col   ati   nes   urlencode   web   编码   through   

原文地址:https://www.cnblogs.com/Wilson6/p/9485968.html

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