需要加密/解密。目前有两种方案:
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);
ajax客户端与服务端传输字符串
最新推荐文章于 2022-06-01 18:36:40 发布