js base64编码,C#解码
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:转载请注明来源 https://www.cnblogs.com/sunshine-wy,疑问和勘误可在下方留言。