소스 검색

增加制定IP

yinyujing 2 년 전
부모
커밋
19288aeb26
3개의 변경된 파일32개의 추가작업 그리고 25개의 파일을 삭제
  1. 3 1
      NB_IOT_TCP_HP_SOCKET/App.config
  2. 24 24
      NB_IOT_TCP_HP_SOCKET/MainForm_TCP.Designer.cs
  3. 5 0
      NB_IOT_TCP_HP_SOCKET/MainForm_TCP.cs

+ 3 - 1
NB_IOT_TCP_HP_SOCKET/App.config

@@ -24,8 +24,10 @@
     <add key="ClientSettingsProvider.ServiceUri" value="" />
     <!--自动启动标志1:自动启动;0:不自动启动-->
     <add key="AutoStart" value="0" />
+    <!--上报IP-->
+    <add key="ReportIP" value="192.168.17.151" />
     <!--上报端口-->
-    <add key="ReportPort" value="" />
+    <add key="ReportPort" value="123" />
     <!--监听端口-->
     <add key="MonitorPort" value="" />
     <!--是否记录所有日志 1:是,0:否(只记录错误日志)-->

+ 24 - 24
NB_IOT_TCP_HP_SOCKET/MainForm_TCP.Designer.cs

@@ -56,13 +56,13 @@
             this.btnStart = new System.Windows.Forms.Button();
             this.splitContainer1 = new System.Windows.Forms.SplitContainer();
             this.panel1 = new System.Windows.Forms.Panel();
+            this.label2 = new System.Windows.Forms.Label();
+            this.label1 = new System.Windows.Forms.Label();
             this.txtMonitorPort = new System.Windows.Forms.TextBox();
             this.button4 = new System.Windows.Forms.Button();
             this.button3 = new System.Windows.Forms.Button();
             this.timer1 = new System.Windows.Forms.Timer(this.components);
             this.splitContainer2 = new System.Windows.Forms.SplitContainer();
-            this.label1 = new System.Windows.Forms.Label();
-            this.label2 = new System.Windows.Forms.Label();
             this.contextMenuStrip1.SuspendLayout();
             this.groupBox3.SuspendLayout();
             this.statusStrip1.SuspendLayout();
@@ -267,7 +267,7 @@
             // 
             // txtPort
             // 
-            this.txtPort.Location = new System.Drawing.Point(161, 15);
+            this.txtPort.Location = new System.Drawing.Point(167, 15);
             this.txtPort.Name = "txtPort";
             this.txtPort.ReadOnly = true;
             this.txtPort.Size = new System.Drawing.Size(40, 21);
@@ -275,10 +275,10 @@
             // 
             // txtIpAddress
             // 
-            this.txtIpAddress.Location = new System.Drawing.Point(10, 14);
+            this.txtIpAddress.Location = new System.Drawing.Point(7, 14);
             this.txtIpAddress.Name = "txtIpAddress";
             this.txtIpAddress.ReadOnly = true;
-            this.txtIpAddress.Size = new System.Drawing.Size(77, 21);
+            this.txtIpAddress.Size = new System.Drawing.Size(101, 21);
             this.txtIpAddress.TabIndex = 18;
             this.txtIpAddress.Text = "0.0.0.0";
             // 
@@ -346,9 +346,27 @@
             this.panel1.Size = new System.Drawing.Size(776, 48);
             this.panel1.TabIndex = 6;
             // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Location = new System.Drawing.Point(224, 19);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(77, 12);
+            this.label2.TabIndex = 27;
+            this.label2.Text = "网站监听端口";
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Location = new System.Drawing.Point(111, 19);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(53, 12);
+            this.label1.TabIndex = 26;
+            this.label1.Text = "上报端口";
+            // 
             // txtMonitorPort
             // 
-            this.txtMonitorPort.Location = new System.Drawing.Point(300, 15);
+            this.txtMonitorPort.Location = new System.Drawing.Point(306, 15);
             this.txtMonitorPort.Name = "txtMonitorPort";
             this.txtMonitorPort.ReadOnly = true;
             this.txtMonitorPort.Size = new System.Drawing.Size(40, 21);
@@ -400,24 +418,6 @@
             this.splitContainer2.SplitterDistance = 325;
             this.splitContainer2.TabIndex = 10;
             // 
-            // label1
-            // 
-            this.label1.AutoSize = true;
-            this.label1.Location = new System.Drawing.Point(105, 19);
-            this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(53, 12);
-            this.label1.TabIndex = 26;
-            this.label1.Text = "上报端口";
-            // 
-            // label2
-            // 
-            this.label2.AutoSize = true;
-            this.label2.Location = new System.Drawing.Point(218, 19);
-            this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(77, 12);
-            this.label2.TabIndex = 27;
-            this.label2.Text = "网站监听端口";
-            // 
             // MainForm_TCP
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);

+ 5 - 0
NB_IOT_TCP_HP_SOCKET/MainForm_TCP.cs

@@ -88,6 +88,11 @@ namespace NB_IOT_TCP_HP_SOCKET
 
                 SetAppState(AppState.UnStart);
 
+                string reportIp = ConfigurationManager.AppSettings["ReportIP"];
+                if (!string.IsNullOrEmpty(reportIp))
+                {
+                    this.txtIpAddress.Text = reportIp;
+                }
                 this.txtPort.Text = ConfigurationManager.AppSettings["ReportPort"];
                 this.txtMonitorPort.Text = ConfigurationManager.AppSettings["MonitorPort"];
                 string AutoStart = ConfigurationManager.AppSettings["AutoStart"];