示例#1
0
        public void Parse(string s)
        {
            Type anytype = typeof(MSG_TABLE_1);

            byte[] rawdatas = Encoding.GetEncoding(936).GetBytes(s);
            int    rawsize  = Marshal.SizeOf(anytype);

            if (rawsize > rawdatas.Length)
            {
                _MSG_TABLE_1 = new MSG_TABLE_1();
            }
            IntPtr buffer = Marshal.AllocHGlobal(rawsize);

            Marshal.Copy(rawdatas, 0, buffer, rawsize);
            object retobj = Marshal.PtrToStructure(buffer, anytype);

            Marshal.FreeHGlobal(buffer);
            _MSG_TABLE_1 = (MSG_TABLE_1)retobj;
        }
示例#2
0
 public Table_1(MSG_TABLE_1 ___MSG_TABLE_1)
 {
     _MSG_TABLE_1 = ___MSG_TABLE_1;
 }