wzp
2021-07-28 864986e4cad03f6b9bba9a7e65379db496b62a6a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
namespace AsiaINFO.SMS.CMPP2
{
    using System;
    using System.Text;
 
    public class CMPP_QUERY
    {
        private MessageHeader _Header;
        private string _Query_Code;
        private uint _Query_Type;
        private string _Reserve;
        private string _Time;
        public const int BodyLength = 0x1b;
 
        public CMPP_QUERY(DateTime Time, uint Query_Type, string Query_Code, string Reserve, uint Sequence_Id)
        {
            this._Time = Util.Get_YYYYMMDD_String(Time);
            this._Query_Type = Query_Type;
            this._Query_Code = Query_Code;
            this._Reserve = Reserve;
            this._Header = new MessageHeader(0x27, CMPP_Command_Id.CMPP_QUERY, Sequence_Id);
        }
 
        public byte[] ToBytes()
        {
            int index = 0;
            byte[] array = new byte[0x27];
            byte[] buffer2 = new byte[12];
            this._Header.ToBytes().CopyTo(array, 0);
            index += 12;
            buffer2 = new byte[10];
            Encoding.ASCII.GetBytes(this._Time).CopyTo(array, index);
            index += 8;
            array[index++] = (byte) this._Query_Type;
            buffer2 = new byte[10];
            Encoding.ASCII.GetBytes(this._Query_Code).CopyTo(array, index);
            index += 10;
            buffer2 = new byte[8];
            Encoding.ASCII.GetBytes(this._Reserve).CopyTo(array, index);
            return array;
        }
 
        public override string ToString()
        {
            return ("[\r\n" + this._Header.ToString() + "\r\n" + string.Format("\tMessageBody:\r\n\t\tQuery_Code: {0}\r\n\t\tQuery_Type: {1}\r\n\t\tReserve: {2}\r\n\t\tTime: {3}\r\n]", new object[] { this._Query_Code, this._Query_Type, this._Reserve, this._Time }) + "\r\n]");
        }
 
        public MessageHeader Header
        {
            get
            {
                return this._Header;
            }
        }
 
        public string Query_Code
        {
            get
            {
                return this._Query_Code;
            }
        }
 
        public uint Query_Type
        {
            get
            {
                return this._Query_Type;
            }
        }
 
        public string Reserve
        {
            get
            {
                return this._Reserve;
            }
        }
 
        public string Time
        {
            get
            {
                return this._Time;
            }
        }
    }
}