据说是可以将字节数组转换成结构。我还没有测试。等要用的时候再来看看吧。先记到这儿。 using System.Runtime.InteropServices; static object BytesToStruct(byte[] bytes, Type strcutType) { int size = Marshal.SizeOf(strcutType); IntPtr buffer = Marshal.AllocHGlobal(size); try { Marshal.Copy(bytes, 0, buffer, size); return Marshal.PtrToStructure(buffer, strcutType); } finally { Marshal.FreeHGlobal(buffer); } } 相关文章: 2021-06-25 2021-12-10 2022-12-23 2022-12-23 2022-12-23 2022-12-23