编码
public string EncodeBase64(string code_type,string code)
{
string encode = "";
byte[] bytes = Encoding.GetEncoding(code_type).GetBytes(code);
try
{
encode = Convert.ToBase64String(bytes);
}
catch
{
encode = code;
}
return encode;
}
解码
public string DecodeBase64(string code_type,string code)
{
string decode = "";
byte[] bytes = Convert.FromBase64String(code);
try
{
decode = Encoding.GetEncoding(code_type).GetString(bytes);
}
catch
{
decode = code;
}
return decode;
}

相关文章:

  • 2022-02-02
  • 2022-12-23
  • 2021-09-12
  • 2022-12-23
  • 2021-12-01
  • 2022-12-23
猜你喜欢
  • 2021-12-24
  • 2022-01-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案