ylbtech-Code:Base64 编码/解码 |
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、
转载于:https://www.cnblogs.com/storebook/p/9188096.html