浏览代码

修改可选连接并登录

张泳健 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
             this.toolStripStatusLabel2 = new System.Windows.Forms.ToolStripStatusLabel();
75
             this.toolStripStatusLabel2 = new System.Windows.Forms.ToolStripStatusLabel();
76
             this.tsslCCIDLEN = new System.Windows.Forms.ToolStripStatusLabel();
76
             this.tsslCCIDLEN = new System.Windows.Forms.ToolStripStatusLabel();
77
             this.toolStripStatusLabelHbShow = new System.Windows.Forms.ToolStripStatusLabel();
77
             this.toolStripStatusLabelHbShow = new System.Windows.Forms.ToolStripStatusLabel();
78
+            this.toolStripStatusLabelSendTime = new System.Windows.Forms.ToolStripStatusLabel();
78
             this.groupBox2 = new System.Windows.Forms.GroupBox();
79
             this.groupBox2 = new System.Windows.Forms.GroupBox();
79
             this.listBoxShow = new System.Windows.Forms.ListBox();
80
             this.listBoxShow = new System.Windows.Forms.ListBox();
80
             this.cmslistboxRightMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
81
             this.cmslistboxRightMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
81
             this.rightMenuCopyCmd = new System.Windows.Forms.ToolStripMenuItem();
82
             this.rightMenuCopyCmd = new System.Windows.Forms.ToolStripMenuItem();
82
             this.rightMenuClearInfo = new System.Windows.Forms.ToolStripMenuItem();
83
             this.rightMenuClearInfo = new System.Windows.Forms.ToolStripMenuItem();
83
             this.timerHeartBeat = new System.Windows.Forms.Timer(this.components);
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
             this.groupBox1.SuspendLayout();
87
             this.groupBox1.SuspendLayout();
86
             this.menuStrip1.SuspendLayout();
88
             this.menuStrip1.SuspendLayout();
87
             this.statusStrip1.SuspendLayout();
89
             this.statusStrip1.SuspendLayout();
425
             // 心跳HToolStripMenuItem
427
             // 心跳HToolStripMenuItem
426
             // 
428
             // 
427
             this.心跳HToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
429
             this.心跳HToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
430
+            this.StripMenuItemLoSucLogin,
431
+            this.toolStripSeparator5,
428
             this.StripMenuItemLoSucHb,
432
             this.StripMenuItemLoSucHb,
429
             this.ToolStripMenuItemHbStart,
433
             this.ToolStripMenuItemHbStart,
430
             this.toolStripSeparator1,
434
             this.toolStripSeparator1,
434
             this.ToolStripMenuItemLogHb});
438
             this.ToolStripMenuItemLogHb});
435
             this.心跳HToolStripMenuItem.Name = "心跳HToolStripMenuItem";
439
             this.心跳HToolStripMenuItem.Name = "心跳HToolStripMenuItem";
436
             this.心跳HToolStripMenuItem.Size = new System.Drawing.Size(61, 21);
440
             this.心跳HToolStripMenuItem.Size = new System.Drawing.Size(61, 21);
437
-            this.心跳HToolStripMenuItem.Text = "心跳(&H)";
441
+            this.心跳HToolStripMenuItem.Text = "指令(&D)";
438
             // 
442
             // 
439
             // StripMenuItemLoSucHb
443
             // StripMenuItemLoSucHb
440
             // 
444
             // 
529
             this.toolStripStatusLabelHbShow.Size = new System.Drawing.Size(82, 17);
533
             this.toolStripStatusLabelHbShow.Size = new System.Drawing.Size(82, 17);
530
             this.toolStripStatusLabelHbShow.Text = "心跳时间: 5秒";
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
             // groupBox2
542
             // groupBox2
533
             // 
543
             // 
534
             this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
544
             this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
590
             this.timerHeartBeat.Interval = 5000;
600
             this.timerHeartBeat.Interval = 5000;
591
             this.timerHeartBeat.Tick += new System.EventHandler(this.timerHeartBeat_Tick);
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
             // Form1
617
             // Form1
600
             // 
618
             // 
680
         private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;
698
         private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;
681
         private System.Windows.Forms.ToolStripMenuItem ClearAllAllToolStripMenuItem;
699
         private System.Windows.Forms.ToolStripMenuItem ClearAllAllToolStripMenuItem;
682
         private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabelSendTime;
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
                             //连接成功
368
                             //连接成功
369
                             addToListboxItem("状态信息:与服务器连接成功");
369
                             addToListboxItem("状态信息:与服务器连接成功");
370
                             addToListboxItem(string.Format("客户端信息{0}", sks.ex));
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
                             if (StripMenuItemLoSucHb.Checked)
378
                             if (StripMenuItemLoSucHb.Checked)
375
                             {
379
                             {
376
                                 ToolStripMenuItemHbStart.Checked = true;
380
                                 ToolStripMenuItemHbStart.Checked = true;
418
             int funcode = Utils.hexToTen(functionWord);
422
             int funcode = Utils.hexToTen(functionWord);
419
 
423
 
420
 
424
 
421
-           
422
-
423
             if (sendCmd)
425
             if (sendCmd)
424
             {
426
             {
425
                 sendCmd = false;
427
                 sendCmd = false;
426
-                long time = (long)(DateTime.Now - sendCmdTime).TotalMilliseconds;
428
+                long time = (long) (DateTime.Now - sendCmdTime).TotalMilliseconds;
427
                 toolStripStatusLabelSendTime.Text = "发送-回复时间: " + time + "/ms";
429
                 toolStripStatusLabelSendTime.Text = "发送-回复时间: " + time + "/ms";
428
             }
430
             }
429
-            
431
+
430
             //处理心跳的回复
432
             //处理心跳的回复
431
             if (funcode == 4)
433
             if (funcode == 4)
432
             {
434
             {

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