JS:
this.Base64 = function (str) { return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function (match, p1) { return String.fromCharCode('0x' + p1); })); }
C#:
public static string UnBase64String(string value) { if (value == null || value == "") { return ""; } byte[] bytes = Convert.FromBase64String(value); return Encoding.UTF8.GetString(bytes); }
PS:楼主邮箱 tccwpl@163.com