Browse Source

add Listbox color

张泳健 8 years ago
parent
commit
f92d057275

BIN
.vs/GWSocketClient/v15/.suo View File


+ 94 - 72
GWSocketClient/Form1.Designer.cs View File

31
             this.components = new System.ComponentModel.Container();
31
             this.components = new System.ComponentModel.Container();
32
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
32
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
33
             this.groupBox1 = new System.Windows.Forms.GroupBox();
33
             this.groupBox1 = new System.Windows.Forms.GroupBox();
34
+            this.label7 = new System.Windows.Forms.Label();
35
+            this.tfTmpResponse = new System.Windows.Forms.TextBox();
36
+            this.label6 = new System.Windows.Forms.Label();
34
             this.tfTmpSendData = new System.Windows.Forms.TextBox();
37
             this.tfTmpSendData = new System.Windows.Forms.TextBox();
35
             this.tbCCID = new System.Windows.Forms.TextBox();
38
             this.tbCCID = new System.Windows.Forms.TextBox();
36
             this.label5 = new System.Windows.Forms.Label();
39
             this.label5 = new System.Windows.Forms.Label();
58
             this.listBoxShow = new System.Windows.Forms.ListBox();
61
             this.listBoxShow = new System.Windows.Forms.ListBox();
59
             this.cmslistboxRightMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
62
             this.cmslistboxRightMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
60
             this.rightMenuCopyCmd = new System.Windows.Forms.ToolStripMenuItem();
63
             this.rightMenuCopyCmd = new System.Windows.Forms.ToolStripMenuItem();
61
-            this.label6 = new System.Windows.Forms.Label();
62
-            this.tfTmpResponse = new System.Windows.Forms.TextBox();
63
-            this.label7 = new System.Windows.Forms.Label();
64
             this.rightMenuClearInfo = new System.Windows.Forms.ToolStripMenuItem();
64
             this.rightMenuClearInfo = new System.Windows.Forms.ToolStripMenuItem();
65
             this.groupBox1.SuspendLayout();
65
             this.groupBox1.SuspendLayout();
66
             this.menuStrip1.SuspendLayout();
66
             this.menuStrip1.SuspendLayout();
91
             this.groupBox1.Controls.Add(this.label2);
91
             this.groupBox1.Controls.Add(this.label2);
92
             this.groupBox1.Controls.Add(this.tbIpaddress);
92
             this.groupBox1.Controls.Add(this.tbIpaddress);
93
             this.groupBox1.Controls.Add(this.label1);
93
             this.groupBox1.Controls.Add(this.label1);
94
-            this.groupBox1.Location = new System.Drawing.Point(12, 28);
94
+            this.groupBox1.Location = new System.Drawing.Point(14, 40);
95
+            this.groupBox1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
95
             this.groupBox1.Name = "groupBox1";
96
             this.groupBox1.Name = "groupBox1";
96
-            this.groupBox1.Size = new System.Drawing.Size(883, 104);
97
+            this.groupBox1.Padding = new System.Windows.Forms.Padding(3, 4, 3, 4);
98
+            this.groupBox1.Size = new System.Drawing.Size(1030, 147);
97
             this.groupBox1.TabIndex = 0;
99
             this.groupBox1.TabIndex = 0;
98
             this.groupBox1.TabStop = false;
100
             this.groupBox1.TabStop = false;
99
             this.groupBox1.Text = "groupBox1";
101
             this.groupBox1.Text = "groupBox1";
100
             // 
102
             // 
103
+            // label7
104
+            // 
105
+            this.label7.AutoSize = true;
106
+            this.label7.Location = new System.Drawing.Point(436, 106);
107
+            this.label7.Name = "label7";
108
+            this.label7.Size = new System.Drawing.Size(32, 17);
109
+            this.label7.TabIndex = 16;
110
+            this.label7.Text = "发送";
111
+            // 
112
+            // tfTmpResponse
113
+            // 
114
+            this.tfTmpResponse.Location = new System.Drawing.Point(55, 102);
115
+            this.tfTmpResponse.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
116
+            this.tfTmpResponse.Name = "tfTmpResponse";
117
+            this.tfTmpResponse.Size = new System.Drawing.Size(374, 23);
118
+            this.tfTmpResponse.TabIndex = 15;
119
+            // 
120
+            // label6
121
+            // 
122
+            this.label6.AutoSize = true;
123
+            this.label6.Location = new System.Drawing.Point(7, 106);
124
+            this.label6.Name = "label6";
125
+            this.label6.Size = new System.Drawing.Size(35, 17);
126
+            this.label6.TabIndex = 14;
127
+            this.label6.Text = "回复:";
128
+            // 
101
             // tfTmpSendData
129
             // tfTmpSendData
102
             // 
130
             // 
103
             this.tfTmpSendData.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
131
             this.tfTmpSendData.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
104
             | System.Windows.Forms.AnchorStyles.Right)));
132
             | System.Windows.Forms.AnchorStyles.Right)));
105
-            this.tfTmpSendData.Location = new System.Drawing.Point(415, 72);
133
+            this.tfTmpSendData.Location = new System.Drawing.Point(484, 102);
134
+            this.tfTmpSendData.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
106
             this.tfTmpSendData.Name = "tfTmpSendData";
135
             this.tfTmpSendData.Name = "tfTmpSendData";
107
-            this.tfTmpSendData.Size = new System.Drawing.Size(462, 21);
136
+            this.tfTmpSendData.Size = new System.Drawing.Size(538, 23);
108
             this.tfTmpSendData.TabIndex = 13;
137
             this.tfTmpSendData.TabIndex = 13;
109
             // 
138
             // 
110
             // tbCCID
139
             // tbCCID
111
             // 
140
             // 
112
             this.tbCCID.ForeColor = System.Drawing.Color.Blue;
141
             this.tbCCID.ForeColor = System.Drawing.Color.Blue;
113
-            this.tbCCID.Location = new System.Drawing.Point(464, 14);
142
+            this.tbCCID.Location = new System.Drawing.Point(541, 20);
143
+            this.tbCCID.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
114
             this.tbCCID.Name = "tbCCID";
144
             this.tbCCID.Name = "tbCCID";
115
-            this.tbCCID.Size = new System.Drawing.Size(294, 21);
145
+            this.tbCCID.Size = new System.Drawing.Size(342, 23);
116
             this.tbCCID.TabIndex = 12;
146
             this.tbCCID.TabIndex = 12;
117
             this.tbCCID.Text = "3839383630324231313931353530343739383737";
147
             this.tbCCID.Text = "3839383630324231313931353530343739383737";
118
             this.tbCCID.TextChanged += new System.EventHandler(this.tbCCID_TextChanged);
148
             this.tbCCID.TextChanged += new System.EventHandler(this.tbCCID_TextChanged);
120
             // label5
150
             // label5
121
             // 
151
             // 
122
             this.label5.AutoSize = true;
152
             this.label5.AutoSize = true;
123
-            this.label5.Location = new System.Drawing.Point(423, 17);
153
+            this.label5.Location = new System.Drawing.Point(493, 24);
124
             this.label5.Name = "label5";
154
             this.label5.Name = "label5";
125
-            this.label5.Size = new System.Drawing.Size(35, 12);
155
+            this.label5.Size = new System.Drawing.Size(45, 17);
126
             this.label5.TabIndex = 11;
156
             this.label5.TabIndex = 11;
127
             this.label5.Text = "CCCID";
157
             this.label5.Text = "CCCID";
128
             // 
158
             // 
129
             // btnPressureTest
159
             // btnPressureTest
130
             // 
160
             // 
131
-            this.btnPressureTest.Location = new System.Drawing.Point(375, 45);
161
+            this.btnPressureTest.Location = new System.Drawing.Point(437, 64);
162
+            this.btnPressureTest.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
132
             this.btnPressureTest.Name = "btnPressureTest";
163
             this.btnPressureTest.Name = "btnPressureTest";
133
-            this.btnPressureTest.Size = new System.Drawing.Size(75, 23);
164
+            this.btnPressureTest.Size = new System.Drawing.Size(87, 33);
134
             this.btnPressureTest.TabIndex = 10;
165
             this.btnPressureTest.TabIndex = 10;
135
             this.btnPressureTest.Text = "压力测试";
166
             this.btnPressureTest.Text = "压力测试";
136
             this.btnPressureTest.UseVisualStyleBackColor = true;
167
             this.btnPressureTest.UseVisualStyleBackColor = true;
138
             // label4
169
             // label4
139
             // 
170
             // 
140
             this.label4.AutoSize = true;
171
             this.label4.AutoSize = true;
141
-            this.label4.Location = new System.Drawing.Point(252, 50);
172
+            this.label4.Location = new System.Drawing.Point(294, 71);
142
             this.label4.Name = "label4";
173
             this.label4.Name = "label4";
143
-            this.label4.Size = new System.Drawing.Size(53, 12);
174
+            this.label4.Size = new System.Drawing.Size(56, 17);
144
             this.label4.TabIndex = 9;
175
             this.label4.TabIndex = 9;
145
             this.label4.Text = "压力测试";
176
             this.label4.Text = "压力测试";
146
             // 
177
             // 
147
             // tbPresureTestCount
178
             // tbPresureTestCount
148
             // 
179
             // 
149
             this.tbPresureTestCount.ForeColor = System.Drawing.Color.Blue;
180
             this.tbPresureTestCount.ForeColor = System.Drawing.Color.Blue;
150
-            this.tbPresureTestCount.Location = new System.Drawing.Point(312, 47);
181
+            this.tbPresureTestCount.Location = new System.Drawing.Point(364, 67);
182
+            this.tbPresureTestCount.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
151
             this.tbPresureTestCount.Name = "tbPresureTestCount";
183
             this.tbPresureTestCount.Name = "tbPresureTestCount";
152
-            this.tbPresureTestCount.Size = new System.Drawing.Size(56, 21);
184
+            this.tbPresureTestCount.Size = new System.Drawing.Size(65, 23);
153
             this.tbPresureTestCount.TabIndex = 8;
185
             this.tbPresureTestCount.TabIndex = 8;
154
             this.tbPresureTestCount.Text = "100";
186
             this.tbPresureTestCount.Text = "100";
155
             // 
187
             // 
156
             // btnSendData
188
             // btnSendData
157
             // 
189
             // 
158
-            this.btnSendData.Location = new System.Drawing.Point(170, 45);
190
+            this.btnSendData.Location = new System.Drawing.Point(198, 64);
191
+            this.btnSendData.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
159
             this.btnSendData.Name = "btnSendData";
192
             this.btnSendData.Name = "btnSendData";
160
-            this.btnSendData.Size = new System.Drawing.Size(75, 23);
193
+            this.btnSendData.Size = new System.Drawing.Size(87, 33);
161
             this.btnSendData.TabIndex = 7;
194
             this.btnSendData.TabIndex = 7;
162
             this.btnSendData.Text = "发送数据";
195
             this.btnSendData.Text = "发送数据";
163
             this.btnSendData.UseVisualStyleBackColor = true;
196
             this.btnSendData.UseVisualStyleBackColor = true;
165
             // 
198
             // 
166
             // btnQuickLogout
199
             // btnQuickLogout
167
             // 
200
             // 
168
-            this.btnQuickLogout.Location = new System.Drawing.Point(88, 45);
201
+            this.btnQuickLogout.Location = new System.Drawing.Point(103, 64);
202
+            this.btnQuickLogout.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
169
             this.btnQuickLogout.Name = "btnQuickLogout";
203
             this.btnQuickLogout.Name = "btnQuickLogout";
170
-            this.btnQuickLogout.Size = new System.Drawing.Size(75, 23);
204
+            this.btnQuickLogout.Size = new System.Drawing.Size(87, 33);
171
             this.btnQuickLogout.TabIndex = 6;
205
             this.btnQuickLogout.TabIndex = 6;
172
             this.btnQuickLogout.Text = "退出登录";
206
             this.btnQuickLogout.Text = "退出登录";
173
             this.btnQuickLogout.UseVisualStyleBackColor = true;
207
             this.btnQuickLogout.UseVisualStyleBackColor = true;
175
             // 
209
             // 
176
             // btnLogin
210
             // btnLogin
177
             // 
211
             // 
178
-            this.btnLogin.Location = new System.Drawing.Point(6, 45);
212
+            this.btnLogin.Location = new System.Drawing.Point(7, 64);
213
+            this.btnLogin.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
179
             this.btnLogin.Name = "btnLogin";
214
             this.btnLogin.Name = "btnLogin";
180
-            this.btnLogin.Size = new System.Drawing.Size(75, 23);
215
+            this.btnLogin.Size = new System.Drawing.Size(87, 33);
181
             this.btnLogin.TabIndex = 3;
216
             this.btnLogin.TabIndex = 3;
182
             this.btnLogin.Text = "登录";
217
             this.btnLogin.Text = "登录";
183
             this.btnLogin.UseVisualStyleBackColor = true;
218
             this.btnLogin.UseVisualStyleBackColor = true;
186
             // tbEquipmentAddress
221
             // tbEquipmentAddress
187
             // 
222
             // 
188
             this.tbEquipmentAddress.ForeColor = System.Drawing.Color.Blue;
223
             this.tbEquipmentAddress.ForeColor = System.Drawing.Color.Blue;
189
-            this.tbEquipmentAddress.Location = new System.Drawing.Point(294, 14);
224
+            this.tbEquipmentAddress.Location = new System.Drawing.Point(343, 20);
225
+            this.tbEquipmentAddress.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
190
             this.tbEquipmentAddress.Name = "tbEquipmentAddress";
226
             this.tbEquipmentAddress.Name = "tbEquipmentAddress";
191
-            this.tbEquipmentAddress.Size = new System.Drawing.Size(123, 21);
227
+            this.tbEquipmentAddress.Size = new System.Drawing.Size(143, 23);
192
             this.tbEquipmentAddress.TabIndex = 5;
228
             this.tbEquipmentAddress.TabIndex = 5;
193
             this.tbEquipmentAddress.Text = "4442832e833c";
229
             this.tbEquipmentAddress.Text = "4442832e833c";
194
             this.tbEquipmentAddress.TextChanged += new System.EventHandler(this.tbEquipmentAddress_TextChanged);
230
             this.tbEquipmentAddress.TextChanged += new System.EventHandler(this.tbEquipmentAddress_TextChanged);
196
             // tbPort
232
             // tbPort
197
             // 
233
             // 
198
             this.tbPort.ForeColor = System.Drawing.Color.Blue;
234
             this.tbPort.ForeColor = System.Drawing.Color.Blue;
199
-            this.tbPort.Location = new System.Drawing.Point(171, 14);
235
+            this.tbPort.Location = new System.Drawing.Point(199, 20);
236
+            this.tbPort.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
200
             this.tbPort.Name = "tbPort";
237
             this.tbPort.Name = "tbPort";
201
-            this.tbPort.Size = new System.Drawing.Size(56, 21);
238
+            this.tbPort.Size = new System.Drawing.Size(65, 23);
202
             this.tbPort.TabIndex = 3;
239
             this.tbPort.TabIndex = 3;
203
             this.tbPort.Text = "15440";
240
             this.tbPort.Text = "15440";
204
             // 
241
             // 
205
             // label3
242
             // label3
206
             // 
243
             // 
207
             this.label3.AutoSize = true;
244
             this.label3.AutoSize = true;
208
-            this.label3.Location = new System.Drawing.Point(234, 17);
245
+            this.label3.Location = new System.Drawing.Point(273, 24);
209
             this.label3.Name = "label3";
246
             this.label3.Name = "label3";
210
-            this.label3.Size = new System.Drawing.Size(53, 12);
247
+            this.label3.Size = new System.Drawing.Size(56, 17);
211
             this.label3.TabIndex = 4;
248
             this.label3.TabIndex = 4;
212
             this.label3.Text = "设备地址";
249
             this.label3.Text = "设备地址";
213
             // 
250
             // 
214
             // label2
251
             // label2
215
             // 
252
             // 
216
             this.label2.AutoSize = true;
253
             this.label2.AutoSize = true;
217
-            this.label2.Location = new System.Drawing.Point(135, 17);
254
+            this.label2.Location = new System.Drawing.Point(157, 24);
218
             this.label2.Name = "label2";
255
             this.label2.Name = "label2";
219
-            this.label2.Size = new System.Drawing.Size(29, 12);
256
+            this.label2.Size = new System.Drawing.Size(32, 17);
220
             this.label2.TabIndex = 2;
257
             this.label2.TabIndex = 2;
221
             this.label2.Text = "端口";
258
             this.label2.Text = "端口";
222
             // 
259
             // 
223
             // tbIpaddress
260
             // tbIpaddress
224
             // 
261
             // 
225
             this.tbIpaddress.ForeColor = System.Drawing.Color.Blue;
262
             this.tbIpaddress.ForeColor = System.Drawing.Color.Blue;
226
-            this.tbIpaddress.Location = new System.Drawing.Point(28, 14);
263
+            this.tbIpaddress.Location = new System.Drawing.Point(33, 20);
264
+            this.tbIpaddress.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
227
             this.tbIpaddress.Name = "tbIpaddress";
265
             this.tbIpaddress.Name = "tbIpaddress";
228
-            this.tbIpaddress.Size = new System.Drawing.Size(100, 21);
266
+            this.tbIpaddress.Size = new System.Drawing.Size(116, 23);
229
             this.tbIpaddress.TabIndex = 1;
267
             this.tbIpaddress.TabIndex = 1;
230
             this.tbIpaddress.Text = "127.0.0.1";
268
             this.tbIpaddress.Text = "127.0.0.1";
231
             // 
269
             // 
232
             // label1
270
             // label1
233
             // 
271
             // 
234
             this.label1.AutoSize = true;
272
             this.label1.AutoSize = true;
235
-            this.label1.Location = new System.Drawing.Point(4, 17);
273
+            this.label1.Location = new System.Drawing.Point(5, 24);
236
             this.label1.Name = "label1";
274
             this.label1.Name = "label1";
237
-            this.label1.Size = new System.Drawing.Size(17, 12);
275
+            this.label1.Size = new System.Drawing.Size(19, 17);
238
             this.label1.TabIndex = 0;
276
             this.label1.TabIndex = 0;
239
             this.label1.Text = "IP";
277
             this.label1.Text = "IP";
240
             // 
278
             // 
244
             this.文件FToolStripMenuItem});
282
             this.文件FToolStripMenuItem});
245
             this.menuStrip1.Location = new System.Drawing.Point(0, 0);
283
             this.menuStrip1.Location = new System.Drawing.Point(0, 0);
246
             this.menuStrip1.Name = "menuStrip1";
284
             this.menuStrip1.Name = "menuStrip1";
247
-            this.menuStrip1.Size = new System.Drawing.Size(907, 25);
285
+            this.menuStrip1.Padding = new System.Windows.Forms.Padding(7, 3, 0, 3);
286
+            this.menuStrip1.Size = new System.Drawing.Size(1058, 27);
248
             this.menuStrip1.TabIndex = 1;
287
             this.menuStrip1.TabIndex = 1;
249
             this.menuStrip1.Text = "menuStrip1";
288
             this.menuStrip1.Text = "menuStrip1";
250
             // 
289
             // 
270
             this.tsslEquipmentAddress,
309
             this.tsslEquipmentAddress,
271
             this.toolStripStatusLabel2,
310
             this.toolStripStatusLabel2,
272
             this.tsslCCIDLEN});
311
             this.tsslCCIDLEN});
273
-            this.statusStrip1.Location = new System.Drawing.Point(0, 617);
312
+            this.statusStrip1.Location = new System.Drawing.Point(0, 883);
274
             this.statusStrip1.Name = "statusStrip1";
313
             this.statusStrip1.Name = "statusStrip1";
275
-            this.statusStrip1.Size = new System.Drawing.Size(907, 22);
314
+            this.statusStrip1.Padding = new System.Windows.Forms.Padding(1, 0, 16, 0);
315
+            this.statusStrip1.Size = new System.Drawing.Size(1058, 22);
276
             this.statusStrip1.TabIndex = 2;
316
             this.statusStrip1.TabIndex = 2;
277
             this.statusStrip1.Text = "statusStrip1";
317
             this.statusStrip1.Text = "statusStrip1";
278
             // 
318
             // 
306
             | System.Windows.Forms.AnchorStyles.Left) 
346
             | System.Windows.Forms.AnchorStyles.Left) 
307
             | System.Windows.Forms.AnchorStyles.Right)));
347
             | System.Windows.Forms.AnchorStyles.Right)));
308
             this.groupBox2.Controls.Add(this.listBoxShow);
348
             this.groupBox2.Controls.Add(this.listBoxShow);
309
-            this.groupBox2.Location = new System.Drawing.Point(12, 396);
349
+            this.groupBox2.Location = new System.Drawing.Point(14, 561);
350
+            this.groupBox2.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
310
             this.groupBox2.Name = "groupBox2";
351
             this.groupBox2.Name = "groupBox2";
311
-            this.groupBox2.Size = new System.Drawing.Size(883, 218);
352
+            this.groupBox2.Padding = new System.Windows.Forms.Padding(3, 4, 3, 4);
353
+            this.groupBox2.Size = new System.Drawing.Size(1030, 309);
312
             this.groupBox2.TabIndex = 13;
354
             this.groupBox2.TabIndex = 13;
313
             this.groupBox2.TabStop = false;
355
             this.groupBox2.TabStop = false;
314
             this.groupBox2.Text = "groupBox2";
356
             this.groupBox2.Text = "groupBox2";
319
             | System.Windows.Forms.AnchorStyles.Left) 
361
             | System.Windows.Forms.AnchorStyles.Left) 
320
             | System.Windows.Forms.AnchorStyles.Right)));
362
             | System.Windows.Forms.AnchorStyles.Right)));
321
             this.listBoxShow.ContextMenuStrip = this.cmslistboxRightMenu;
363
             this.listBoxShow.ContextMenuStrip = this.cmslistboxRightMenu;
322
-            this.listBoxShow.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
364
+            this.listBoxShow.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed;
365
+            this.listBoxShow.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
323
             this.listBoxShow.FormattingEnabled = true;
366
             this.listBoxShow.FormattingEnabled = true;
324
             this.listBoxShow.HorizontalScrollbar = true;
367
             this.listBoxShow.HorizontalScrollbar = true;
325
             this.listBoxShow.ItemHeight = 14;
368
             this.listBoxShow.ItemHeight = 14;
326
-            this.listBoxShow.Location = new System.Drawing.Point(8, 20);
369
+            this.listBoxShow.Location = new System.Drawing.Point(9, 28);
370
+            this.listBoxShow.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
327
             this.listBoxShow.Name = "listBoxShow";
371
             this.listBoxShow.Name = "listBoxShow";
328
-            this.listBoxShow.Size = new System.Drawing.Size(869, 172);
372
+            this.listBoxShow.Size = new System.Drawing.Size(1013, 242);
329
             this.listBoxShow.TabIndex = 0;
373
             this.listBoxShow.TabIndex = 0;
374
+            this.listBoxShow.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.listBoxShow_DrawItem);
330
             // 
375
             // 
331
             // cmslistboxRightMenu
376
             // cmslistboxRightMenu
332
             // 
377
             // 
339
             // rightMenuCopyCmd
384
             // rightMenuCopyCmd
340
             // 
385
             // 
341
             this.rightMenuCopyCmd.Name = "rightMenuCopyCmd";
386
             this.rightMenuCopyCmd.Name = "rightMenuCopyCmd";
342
-            this.rightMenuCopyCmd.Size = new System.Drawing.Size(152, 22);
387
+            this.rightMenuCopyCmd.Size = new System.Drawing.Size(140, 22);
343
             this.rightMenuCopyCmd.Text = "复制指令(&C)";
388
             this.rightMenuCopyCmd.Text = "复制指令(&C)";
344
             this.rightMenuCopyCmd.Click += new System.EventHandler(this.rightMenuCopyCmd_Click);
389
             this.rightMenuCopyCmd.Click += new System.EventHandler(this.rightMenuCopyCmd_Click);
345
             // 
390
             // 
346
-            // label6
347
-            // 
348
-            this.label6.AutoSize = true;
349
-            this.label6.Location = new System.Drawing.Point(6, 75);
350
-            this.label6.Name = "label6";
351
-            this.label6.Size = new System.Drawing.Size(35, 12);
352
-            this.label6.TabIndex = 14;
353
-            this.label6.Text = "回复:";
354
-            // 
355
-            // tfTmpResponse
356
-            // 
357
-            this.tfTmpResponse.Location = new System.Drawing.Point(47, 72);
358
-            this.tfTmpResponse.Name = "tfTmpResponse";
359
-            this.tfTmpResponse.Size = new System.Drawing.Size(321, 21);
360
-            this.tfTmpResponse.TabIndex = 15;
361
-            // 
362
-            // label7
363
-            // 
364
-            this.label7.AutoSize = true;
365
-            this.label7.Location = new System.Drawing.Point(374, 75);
366
-            this.label7.Name = "label7";
367
-            this.label7.Size = new System.Drawing.Size(29, 12);
368
-            this.label7.TabIndex = 16;
369
-            this.label7.Text = "发送";
370
-            // 
371
             // rightMenuClearInfo
391
             // rightMenuClearInfo
372
             // 
392
             // 
373
             this.rightMenuClearInfo.Name = "rightMenuClearInfo";
393
             this.rightMenuClearInfo.Name = "rightMenuClearInfo";
374
-            this.rightMenuClearInfo.Size = new System.Drawing.Size(152, 22);
394
+            this.rightMenuClearInfo.Size = new System.Drawing.Size(140, 22);
375
             this.rightMenuClearInfo.Text = "清空信息(&L)";
395
             this.rightMenuClearInfo.Text = "清空信息(&L)";
376
             this.rightMenuClearInfo.Click += new System.EventHandler(this.rightMenuClearInfo_Click);
396
             this.rightMenuClearInfo.Click += new System.EventHandler(this.rightMenuClearInfo_Click);
377
             // 
397
             // 
378
             // Form1
398
             // Form1
379
             // 
399
             // 
380
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
400
+            this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
381
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
401
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
382
-            this.ClientSize = new System.Drawing.Size(907, 639);
402
+            this.ClientSize = new System.Drawing.Size(1058, 905);
383
             this.Controls.Add(this.groupBox2);
403
             this.Controls.Add(this.groupBox2);
384
             this.Controls.Add(this.statusStrip1);
404
             this.Controls.Add(this.statusStrip1);
385
             this.Controls.Add(this.groupBox1);
405
             this.Controls.Add(this.groupBox1);
386
             this.Controls.Add(this.menuStrip1);
406
             this.Controls.Add(this.menuStrip1);
407
+            this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
387
             this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
408
             this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
409
+            this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
388
             this.Name = "Form1";
410
             this.Name = "Form1";
389
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
411
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
390
             this.Text = "Form1";
412
             this.Text = "Form1";

+ 59 - 15
GWSocketClient/Form1.cs View File

107
             int funcode = Utils.hexToTen(functionWord);
107
             int funcode = Utils.hexToTen(functionWord);
108
 
108
 
109
 
109
 
110
-            if (funcode >= 80 || funcode == 1 || funcode == 2)
110
+            if (funcode == 16 || funcode == 32)
111
             {
111
             {
112
-                return;
113
-            }
114
-            funcode = funcode + 128;
115
-            functionWord = Utils.stringWith0(Utils.tenToHex(funcode), 2);
116
-            string cmd = reqData.Substring(0, 18) + functionWord;
117
-            string data = reqData.Substring(24, 10) + resp;
118
-            cmd = cmd + Utils.stringWith0(Utils.tenToHex(data.Length / 2), 4) + data;
119
-            cmd = Utils.calcCrcCode(cmd);
112
+                funcode = funcode + 128;
113
+                functionWord = Utils.stringWith0(Utils.tenToHex(funcode), 2);
114
+                string cmd = reqData.Substring(0, 18) + functionWord;
115
+                string data = reqData.Substring(24, 10) + resp;
116
+                cmd = cmd + Utils.stringWith0(Utils.tenToHex(data.Length / 2), 4) + data;
117
+                cmd = Utils.calcCrcCode(cmd);
120
 
118
 
121
-            addToListboxItem(string.Format("回复服务端{0}回应消息:[{1}]", sks.Ip, cmd));
119
+                addToListboxItem(string.Format("回复服务端{0}回应消息:[{1}]", sks.Ip, cmd));
122
 
120
 
123
-            byte[] ts = HexUtil.hexToBytes(cmd);
124
-            sockeTcpClients.SendData(ts);
121
+                byte[] ts = HexUtil.hexToBytes(cmd);
122
+                sockeTcpClients.SendData(ts);
123
+            }
125
         }
124
         }
126
 
125
 
127
         private void tbEquipmentAddress_TextChanged(object sender, EventArgs e)
126
         private void tbEquipmentAddress_TextChanged(object sender, EventArgs e)
141
                 sockeTcpClients.InitSocket(ip, int.Parse(port));
140
                 sockeTcpClients.InitSocket(ip, int.Parse(port));
142
                 sockeTcpClients.Start();
141
                 sockeTcpClients.Start();
143
 
142
 
144
-                string loginCmd = "7e7e7e4442832e833c8200143839383630324231313931353530343739383737f7";
143
+                //                string loginCmd = "7e7e7e4442832e833c8200143839383630324231313931353530343739383737f7";
144
+                string loginCmd = "7e7e7e";
145
+                loginCmd += tbEquipmentAddress.Text.Trim() + "82" +
146
+                            Utils.stringWith0(Utils.tenToHex(tbCCID.Text.Trim().Length / 2), 4);
147
+                loginCmd += tbCCID.Text.Trim();
148
+                loginCmd = Utils.calcCrcCode(loginCmd);
145
                 //发送登录命令
149
                 //发送登录命令
146
                 byte[] ts = HexUtil.hexToBytes(loginCmd);
150
                 byte[] ts = HexUtil.hexToBytes(loginCmd);
147
 
151
 
171
 
175
 
172
         private void tsmiLoadXml_Click(object sender, EventArgs e)
176
         private void tsmiLoadXml_Click(object sender, EventArgs e)
173
         {
177
         {
178
+            OpenFileDialog ofd = new OpenFileDialog();
179
+            ofd.Filter = "XML文件|*.xml|所有文件|*.*";
180
+
181
+            if (ofd.ShowDialog() == DialogResult.OK)
182
+            {
183
+                string xmlFilepath = ofd.FileName;
184
+
185
+                vcarecityProtocolBean = new XmlLoader().load(xmlFilepath).getVcarecityPD();
186
+            }
174
         }
187
         }
175
 
188
 
176
         private void btnSendData_Click(object sender, EventArgs e)
189
         private void btnSendData_Click(object sender, EventArgs e)
191
         private void rightMenuCopyCmd_Click(object sender, EventArgs e)
204
         private void rightMenuCopyCmd_Click(object sender, EventArgs e)
192
         {
205
         {
193
             int index = listBoxShow.SelectedIndex;
206
             int index = listBoxShow.SelectedIndex;
194
-            if (index > 0 && index < listBoxShow.Items.Count)
207
+            if (index >= 0 && index < listBoxShow.Items.Count)
195
             {
208
             {
196
                 string info = listBoxShow.SelectedItem.ToString();
209
                 string info = listBoxShow.SelectedItem.ToString();
197
                 if (!info.Equals(""))
210
                 if (!info.Equals(""))
198
                 {
211
                 {
199
-                    if (info.Contains("["))
212
+                    if (info.Contains("[") || info.Contains("]"))
200
                     {
213
                     {
201
                         Regex reg = new Regex(@"\[\w+\]"); //注意里面的引号 要用双引号表示,而不是用反斜
214
                         Regex reg = new Regex(@"\[\w+\]"); //注意里面的引号 要用双引号表示,而不是用反斜
202
                         Match match = reg.Match(info);
215
                         Match match = reg.Match(info);
211
                             Clipboard.SetDataObject(info);
224
                             Clipboard.SetDataObject(info);
212
                         }
225
                         }
213
                     }
226
                     }
227
+                    else
228
+                    {
229
+                        Clipboard.SetDataObject(info);
230
+                    }
214
                 }
231
                 }
215
             }
232
             }
216
         }
233
         }
231
         {
248
         {
232
             listBoxShow.Items.Clear();
249
             listBoxShow.Items.Clear();
233
         }
250
         }
251
+
252
+        private void listBoxShow_DrawItem(object sender, DrawItemEventArgs e)
253
+        {
254
+            e.DrawBackground();
255
+            //
256
+            string res = listBoxShow.Items[e.Index].ToString().ToLower();
257
+            if (res.Contains("收到服务端"))
258
+            {
259
+                Font f = new Font("微软雅黑", e.Font.Size, FontStyle.Bold);
260
+
261
+                e.Graphics.DrawString(((ListBox) sender).Items[e.Index].ToString(), f, new SolidBrush(Color.Blue),
262
+                    e.Bounds);
263
+            }
264
+            else if (res.Contains("发送到服务端") || res.Contains("回复"))
265
+            {
266
+                Font f = new Font("微软雅黑", e.Font.Size, FontStyle.Italic);
267
+                e.Graphics.DrawString(((ListBox) sender).Items[e.Index].ToString(), f,
268
+                    new SolidBrush(Color.BlueViolet),
269
+                    e.Bounds);
270
+            }
271
+            else
272
+            {
273
+                e.Graphics.DrawString(((ListBox) sender).Items[e.Index].ToString(), e.Font, new SolidBrush(e.ForeColor),
274
+                    e.Bounds);
275
+            }
276
+            e.DrawFocusRectangle();
277
+        }
234
     }
278
     }
235
 }
279
 }

+ 1 - 1
GWSocketClient/GWSocketClient.csproj View File

5
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6
     <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6
     <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7
     <ProjectGuid>{1E7C256A-9CA5-4937-A5DD-7F281A2EBB21}</ProjectGuid>
7
     <ProjectGuid>{1E7C256A-9CA5-4937-A5DD-7F281A2EBB21}</ProjectGuid>
8
-    <OutputType>Exe</OutputType>
8
+    <OutputType>WinExe</OutputType>
9
     <RootNamespace>GWSocketClient</RootNamespace>
9
     <RootNamespace>GWSocketClient</RootNamespace>
10
     <AssemblyName>GWSocketClient</AssemblyName>
10
     <AssemblyName>GWSocketClient</AssemblyName>
11
     <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
11
     <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>

+ 1 - 1
GWSocketClient/Properties/AssemblyInfo.cs View File

8
 [assembly: AssemblyTitle("GWSocketClient")]
8
 [assembly: AssemblyTitle("GWSocketClient")]
9
 [assembly: AssemblyDescription("")]
9
 [assembly: AssemblyDescription("")]
10
 [assembly: AssemblyConfiguration("")]
10
 [assembly: AssemblyConfiguration("")]
11
-[assembly: AssemblyCompany("Microsoft")]
11
+[assembly: AssemblyCompany("Vcarecity")]
12
 [assembly: AssemblyProduct("GWSocketClient")]
12
 [assembly: AssemblyProduct("GWSocketClient")]
13
 [assembly: AssemblyCopyright("Copyright © Microsoft 2017")]
13
 [assembly: AssemblyCopyright("Copyright © Microsoft 2017")]
14
 [assembly: AssemblyTrademark("")]
14
 [assembly: AssemblyTrademark("")]