Code:Base64 编码/解码

ylbtech-Code:Base64 编码/解码
1. C#返回顶部
1、编码
byte[] inArray = new byte[msgTxt.Length];
int x;
for(x=0; x < msgTxt.Length; x++) {
     inArray[x] = (byte)charArray[x];
}
string encodedString = Convert.ToBase64String(inArray,0,inArray.Length,Base64FormattingOptions.None);
2、解码
byte[] outArray = Convert.FromBase64String(respMsg);
char[] outCharArray =new char[outArray.Length];
for (x = 0; x < outArray.Length; x++)
{
     outCharArray[x] = (char)outArray[x];
}
string decodedString = new string(outCharArray);
3、
4、
2.返回顶部
 
3.返回顶部
 
4.返回顶部
 
5.返回顶部
 
 
6.返回顶部
 
warn 作者:ylbtech
出处:http://ylbtech.cnblogs.com/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。

猜你喜欢

转载自www.cnblogs.com/storebook/p/9188096.html