【分享】Struct <--> Byte[]
摘要:static byte[] StructToBytes(object structObj){int size = Marshal.SizeOf(structObj);IntPtr buffer = Marshal.AllocHGlobal(size);try{Marshal.StructureToPtr(structObj, buffer, false);byte[] bytes = new b...
阅读全文
posted @ 2004-03-30 11:05