在c#中简单的int和byte数组互相转换
int s = 100;
byte[] shi = System.BitConverter.GetBytes(s);
int sh = System.BitConverter.ToInt32(shi,0);
本文介绍了一种在C#中实现int类型数据与byte数组相互转换的方法。通过使用System.BitConverter类的GetBytes和ToInt32方法,可以轻松完成数据类型的转换。
在c#中简单的int和byte数组互相转换
int s = 100;
byte[] shi = System.BitConverter.GetBytes(s);
int sh = System.BitConverter.ToInt32(shi,0);
4117
1404

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