0%

CSharp常用数据转换

示例

1
2
3
4
5
6
7
8
9
10
11
12
//int转8字节有符号整型
int iValue = 254
int int8 = (sbyte)iValue;

//byte数组传输
byte[] sendBytes = new byte[]{0x01, 0x02, 0x03};
string base64String = Convert.ToBase64String(sendBytes);

byte[] recvBytes = Convert.FromBase64String(base64String);

//