JS加密對應的c#解碼

 

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配置的默認編碼去解密的。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章