参考:https://blog.csdn.net/emeer/article/details/2060014
int s = 100;
byte[] shi = System.BitConverter.GetBytes(s);
int sh = System.BitConverter.ToInt32(shi,0);
提取第一个字节的数据直接byte[0]
本文详细介绍了在C#中如何将整数类型的数据转换为字节数组,以及如何从字节数组中提取整数值。通过使用System.BitConverter类的方法,如GetBytes和ToInt32,可以轻松实现数据类型的转换。
参考:https://blog.csdn.net/emeer/article/details/2060014
int s = 100;
byte[] shi = System.BitConverter.GetBytes(s);
int sh = System.BitConverter.ToInt32(shi,0);
提取第一个字节的数据直接byte[0]
1404
4117
3832
897
708

被折叠的 条评论
为什么被折叠?
