浙林龙哥

   :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
需要加密/解密。目前有两种方案:

1.URL Encode
client:
1)Encode:
escape(utf16to8(strValue));

2)Decode:
utf8to16(unescape(strValue));


Server:
1)Encode:
Server.UrlEncode(strValue);

2)Decode:
Server.UrlDecode(strValue);



2.BASE64
client:
1)Encode:
base64decode(utf16to8(strValue));

2)Decode:
utf8to16(base64decode(strValue));

Server:
1)Encode:
byte[] ary=Encoding.UTF8.GetBytes(strValue);
string str=Convert.ToBase64String(ary);

2)Decode:
byte[] ary=Convert.FromBase64String(strValue);
string str=Encoding.UTF8.GetString(ary);
posted on 2007-02-15 15:12  浙林龙哥  阅读(391)  评论(0编辑  收藏  举报