C#中byte[]、struct,Intptr之间相互转化
//byte[]转换为structpublic static object BytesToStruct(byte[] bytes, Type type){int size = Marshal.SizeOf(type);IntPtr buffer = Marshal.AllocHGlobal(size);try{Marshal.Copy(bytes, 0, buffer, size);...
原创
2019-02-22 16:58:39 ·
2967 阅读 ·
0 评论