方法一:
string str = "ETF卓越50";
byte[] bytes = System.Text.Encoding.GetEncoding("utf-8").GetBytes(str);
//將字串轉譯成Base64
string base64 = Convert.ToBase64String(bytes);
//將Base64還原成字串
string MyStr = System.Text.Encoding.GetEncoding("utf-8").GetString(Convert.FromBase64String(base64));
方法二:
string str = "ETF卓越50";
byte[] bytes = System.Text.Encoding.UTF8.GetBytes(str);
//將字串轉譯成Base64
string base64 = Convert.ToBase64String(bytes);
//將Base64還原成字串
string MyStr = System.Text.Encoding.UTF8.GetString(Convert.FromBase64String(base64));
沒有留言:
張貼留言