瀏覽代碼

修改可选连接并登录

张泳健 7 年之前
父節點
當前提交
3b30359aa5
共有 3 個文件被更改,包括 34 次插入12 次删除
  1. 26 6
      GWSocketClient/Form1.Designer.cs
  2. 8 6
      GWSocketClient/Form1.cs
  3. 二進制
      GWSocketClient/bin/Release/dbfile/ID_INFO.accdb

+ 26 - 6
GWSocketClient/Form1.Designer.cs 查看文件

@@ -75,13 +75,15 @@
75 75
             this.toolStripStatusLabel2 = new System.Windows.Forms.ToolStripStatusLabel();
76 76
             this.tsslCCIDLEN = new System.Windows.Forms.ToolStripStatusLabel();
77 77
             this.toolStripStatusLabelHbShow = new System.Windows.Forms.ToolStripStatusLabel();
78
+            this.toolStripStatusLabelSendTime = new System.Windows.Forms.ToolStripStatusLabel();
78 79
             this.groupBox2 = new System.Windows.Forms.GroupBox();
79 80
             this.listBoxShow = new System.Windows.Forms.ListBox();
80 81
             this.cmslistboxRightMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
81 82
             this.rightMenuCopyCmd = new System.Windows.Forms.ToolStripMenuItem();
82 83
             this.rightMenuClearInfo = new System.Windows.Forms.ToolStripMenuItem();
83 84
             this.timerHeartBeat = new System.Windows.Forms.Timer(this.components);
84
-            this.toolStripStatusLabelSendTime = new System.Windows.Forms.ToolStripStatusLabel();
85
+            this.StripMenuItemLoSucLogin = new System.Windows.Forms.ToolStripMenuItem();
86
+            this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();
85 87
             this.groupBox1.SuspendLayout();
86 88
             this.menuStrip1.SuspendLayout();
87 89
             this.statusStrip1.SuspendLayout();
@@ -425,6 +427,8 @@
425 427
             // 心跳HToolStripMenuItem
426 428
             // 
427 429
             this.心跳HToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
430
+            this.StripMenuItemLoSucLogin,
431
+            this.toolStripSeparator5,
428 432
             this.StripMenuItemLoSucHb,
429 433
             this.ToolStripMenuItemHbStart,
430 434
             this.toolStripSeparator1,
@@ -434,7 +438,7 @@
434 438
             this.ToolStripMenuItemLogHb});
435 439
             this.心跳HToolStripMenuItem.Name = "心跳HToolStripMenuItem";
436 440
             this.心跳HToolStripMenuItem.Size = new System.Drawing.Size(61, 21);
437
-            this.心跳HToolStripMenuItem.Text = "心跳(&H)";
441
+            this.心跳HToolStripMenuItem.Text = "指令(&D)";
438 442
             // 
439 443
             // StripMenuItemLoSucHb
440 444
             // 
@@ -529,6 +533,12 @@
529 533
             this.toolStripStatusLabelHbShow.Size = new System.Drawing.Size(82, 17);
530 534
             this.toolStripStatusLabelHbShow.Text = "心跳时间: 5秒";
531 535
             // 
536
+            // toolStripStatusLabelSendTime
537
+            // 
538
+            this.toolStripStatusLabelSendTime.Name = "toolStripStatusLabelSendTime";
539
+            this.toolStripStatusLabelSendTime.Size = new System.Drawing.Size(85, 17);
540
+            this.toolStripStatusLabelSendTime.Text = "发送-回复时间";
541
+            // 
532 542
             // groupBox2
533 543
             // 
534 544
             this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
@@ -590,11 +600,19 @@
590 600
             this.timerHeartBeat.Interval = 5000;
591 601
             this.timerHeartBeat.Tick += new System.EventHandler(this.timerHeartBeat_Tick);
592 602
             // 
593
-            // toolStripStatusLabelSendTime
603
+            // StripMenuItemLoSucLogin
594 604
             // 
595
-            this.toolStripStatusLabelSendTime.Name = "toolStripStatusLabelSendTime";
596
-            this.toolStripStatusLabelSendTime.Size = new System.Drawing.Size(85, 17);
597
-            this.toolStripStatusLabelSendTime.Text = "发送-回复时间";
605
+            this.StripMenuItemLoSucLogin.Checked = true;
606
+            this.StripMenuItemLoSucLogin.CheckOnClick = true;
607
+            this.StripMenuItemLoSucLogin.CheckState = System.Windows.Forms.CheckState.Checked;
608
+            this.StripMenuItemLoSucLogin.Name = "StripMenuItemLoSucLogin";
609
+            this.StripMenuItemLoSucLogin.Size = new System.Drawing.Size(196, 22);
610
+            this.StripMenuItemLoSucLogin.Text = "连接成功发送登录";
611
+            // 
612
+            // toolStripSeparator5
613
+            // 
614
+            this.toolStripSeparator5.Name = "toolStripSeparator5";
615
+            this.toolStripSeparator5.Size = new System.Drawing.Size(193, 6);
598 616
             // 
599 617
             // Form1
600 618
             // 
@@ -680,6 +698,8 @@
680 698
         private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;
681 699
         private System.Windows.Forms.ToolStripMenuItem ClearAllAllToolStripMenuItem;
682 700
         private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabelSendTime;
701
+        private System.Windows.Forms.ToolStripMenuItem StripMenuItemLoSucLogin;
702
+        private System.Windows.Forms.ToolStripSeparator toolStripSeparator5;
683 703
     }
684 704
 }
685 705
 

+ 8 - 6
GWSocketClient/Form1.cs 查看文件

@@ -368,9 +368,13 @@ namespace GWSocketClient
368 368
                             //连接成功
369 369
                             addToListboxItem("状态信息:与服务器连接成功");
370 370
                             addToListboxItem(string.Format("客户端信息{0}", sks.ex));
371
-                            sendLoginCmd();
372
-                            checkLogin(true);
373 371
 
372
+
373
+                            checkLogin(true);
374
+                            if (StripMenuItemLoSucLogin.Checked)
375
+                            {
376
+                                sendLoginCmd();
377
+                            }
374 378
                             if (StripMenuItemLoSucHb.Checked)
375 379
                             {
376 380
                                 ToolStripMenuItemHbStart.Checked = true;
@@ -418,15 +422,13 @@ namespace GWSocketClient
418 422
             int funcode = Utils.hexToTen(functionWord);
419 423
 
420 424
 
421
-           
422
-
423 425
             if (sendCmd)
424 426
             {
425 427
                 sendCmd = false;
426
-                long time = (long)(DateTime.Now - sendCmdTime).TotalMilliseconds;
428
+                long time = (long) (DateTime.Now - sendCmdTime).TotalMilliseconds;
427 429
                 toolStripStatusLabelSendTime.Text = "发送-回复时间: " + time + "/ms";
428 430
             }
429
-            
431
+
430 432
             //处理心跳的回复
431 433
             if (funcode == 4)
432 434
             {

二進制
GWSocketClient/bin/Release/dbfile/ID_INFO.accdb 查看文件