110,533
社区成员
发帖
与我相关
我的任务
分享
public void Test() {
short[] st = new short[] { 0x01, 0x03, 0x02, 0x04 };
byte[] b= Array.ConvertAll(st, new Converter<short, byte>(ShortToByte));
foreach (byte n in b)
{
this.d.Text += n + ":";
}
}
public static byte ShortToByte(short pf)
{
return Convert.ToByte(pf);
}
short[] shortArray = new short[] { 0x00, 0x05 };
byte[] byteArray = Array.ConvertAll<short, byte>(shortArray, new Converter<short, byte>(delegate(short value)
{
return (byte)value;
}));