Browse Source

修改Ftp上传慢的问题

callm 5 days ago
parent
commit
f2fd443090
2 changed files with 8 additions and 6 deletions
  1. 1 1
      FileWatcher/AutoAnalysisXml.Designer.cs
  2. 7 5
      FileWatcher/AutoAnalysisXml.cs

+ 1 - 1
FileWatcher/AutoAnalysisXml.Designer.cs

@@ -369,7 +369,7 @@
             this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.MaximizeBox = false;
             this.Name = "AutoAnalysisXml";
-            this.Text = "UAS自动过站解析器 2024-12-17";
+            this.Text = "UAS自动过站解析器 2026-04-29";
             this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
             this.Load += new System.EventHandler(this.Form1_Load);
             ((System.ComponentModel.ISupportInitialize)(this.XmlWatcher)).EndInit();

+ 7 - 5
FileWatcher/AutoAnalysisXml.cs

@@ -331,13 +331,15 @@ namespace FileWatcher
                                 try
                                 {
                                     string ftppath = "/" + DateTime.Now.ToString("yyyy-MM-dd") + "/";
+                                    OperateResult.AppendText("开始上传日志:" + DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss fff") + "\n");
                                     ftp.UpLoadFile(folderpath, SN + ".txt", ftppath, "");
+                                    OperateResult.AppendText("上传日志结束:" + DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss fff") + "\n");
                                     int num = int.Parse(dh.ExecuteSql("insert into STEPTESTDETAIL (std_id,std_sn,std_makecode,std_indate,std_class)select STEPTESTDETAIL_seq.nextval,ms_sncode,ms_makecode,sysdate,'http://113.98.196.181:8099/ftp" + ftppath + SN + ".txt" + "' from makeserial where substr(ms_sncode,0,12)='" + SN + "'", "insert").ToString());
                                     if (num > 0)
                                     {
                                         OperateResult.AppendText("序列号:" + SN + "上传成功\n");
-                                        if (BackUpFolderPath.Text != "") 
-                                        File.Move(filename, BackUpFolderPath.Text);
+                                        if (BackUpFolderPath.Text != "")
+                                            File.Move(filename, BackUpFolderPath.Text+"/"+ SN+".txt");
                                         //SafeDeleteFile(FileName);
                                     }
                                     else
@@ -377,15 +379,15 @@ namespace FileWatcher
                                 try
                                 {
                                     string ftppath = "/" + DateTime.Now.ToString("yyyy-MM-dd") + "/";
-                                    OperateResult.AppendText(DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss fff") + "\n");
+                                    OperateResult.AppendText("开始上传日志:" + DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss fff") + "\n");
                                     ftp.UpLoadFile(folderpath, SN + ".txt", ftppath, "");
-                                    OperateResult.AppendText(DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss fff") + "\n");
+                                    OperateResult.AppendText("上传日志结束:" + DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss fff") + "\n");
                                     int num = int.Parse(dh.ExecuteSql("insert into STEPTESTDETAIL (std_id,std_sn,std_makecode,std_indate,std_class)select STEPTESTDETAIL_seq.nextval,ms_sncode,ms_makecode,sysdate,'http://113.98.196.181:8099/ftp" + ftppath + SN + ".txt" + "' from makeserial where ms_sncode='" + SN + "'", "insert").ToString());
                                     if (num > 0)
                                     {
                                         OperateResult.AppendText("序列号:" + SN + "上传成功\n");
                                         if (BackUpFolderPath.Text != "")
-                                            File.Move(filename, BackUpFolderPath.Text);
+                                            File.Move(filename, BackUpFolderPath.Text + "/" + SN + ".txt");
                                         //SafeDeleteFile(FileName);
                                     }
                                     else