//拼接高低位
public static string[] CombineHighLowString(byte[] WillBuild)
{
string[] combinedBytes = new string[WillBuild.Length / 2];
int j = 0;
for (int i = 0; i < WillBuild.Length; i += 2)
{
//Console.WriteLine(WillBuild[i] << 8);
//Console.WriteLine(WillBuild[i + 1] & 0xFF);
combinedBytes[j++] = ((WillBuild[i] << 8) | (WillBuild[i + 1] & 0xFF)).ToString();
}
return combinedBytes;
}
刚开始写出来想以byte[]型传出,后面一直不行,不停调试都没问题,知道后面才想起,C#中byte存储范围是0~255,所以改成string传出。