Kaynağa Gözat

增加删除指定配置文件和样机测试记录文件,删除文件夹功能目前失效(被删除文件夹不能有文件)。

Dail 1 yıl önce
ebeveyn
işleme
5d86e9ab05

BIN
.vs/Welling_Motor_Debug_Tool/v17/.suo


+ 1 - 0
Welling_Motor_Debug_Tool/LocalInfo.cs

@@ -20,6 +20,7 @@ namespace Welling_Motor_Debug_Tool
         public string CfgPathName = "cfg\\"; //配置目录
         public string WalkLogPathName = "funcTest\\"; //推行测试目录
         public string CheckPathName = "qcTest\\"; //检验目录
+        public string SampleFileName = "Samples\\";//样机提交记录
         public string VersionPathName = "version\\"; //版本信息
     }
 }

+ 102 - 98
Welling_Motor_Debug_Tool/mainForm.Designer.cs

@@ -104,6 +104,9 @@ namespace Welling_Motor_Debug_Tool
             this.页面保存ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.屏幕键盘ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.指令调试ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.删除远程文件ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.生产配置文件ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.样机测试记录ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.查询ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.调试记录数据ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.生产记录数据ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@@ -181,6 +184,7 @@ namespace Welling_Motor_Debug_Tool
             this.button_ReadAssistParam = new System.Windows.Forms.Button();
             this.richTextBox_AssistParam = new System.Windows.Forms.RichTextBox();
             this.tabPage_UsrRideParam = new System.Windows.Forms.TabPage();
+            this.checkBox_UserRideParam_OBC = new System.Windows.Forms.CheckBox();
             this.button_WriteUsrRidetParam = new System.Windows.Forms.Button();
             this.button_ReadUsrRideParam = new System.Windows.Forms.Button();
             this.richTextBox_UsrRidesParam = new System.Windows.Forms.RichTextBox();
@@ -295,6 +299,9 @@ namespace Welling_Motor_Debug_Tool
             this.label50 = new System.Windows.Forms.Label();
             this.label51 = new System.Windows.Forms.Label();
             this.groupBox13 = new System.Windows.Forms.GroupBox();
+            this.numericUpDown_OBC_SpeedLimitAdj = new System.Windows.Forms.NumericUpDown();
+            this.label80 = new System.Windows.Forms.Label();
+            this.label128 = new System.Windows.Forms.Label();
             this.label64 = new System.Windows.Forms.Label();
             this.numericUpDown_OBC_OffTime = new System.Windows.Forms.NumericUpDown();
             this.label63 = new System.Windows.Forms.Label();
@@ -580,15 +587,8 @@ namespace Welling_Motor_Debug_Tool
             this.label_UserName = new System.Windows.Forms.Label();
             this.label124 = new System.Windows.Forms.Label();
             this.label46 = new System.Windows.Forms.Label();
-            this.numericUpDown_OBC_SpeedLimitAdj = new System.Windows.Forms.NumericUpDown();
-            this.label80 = new System.Windows.Forms.Label();
-            this.label128 = new System.Windows.Forms.Label();
-            this.checkBox_UserRideParam_OBC = new System.Windows.Forms.CheckBox();
-            this.删除远程文件ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.生产配置文件ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.样机测试记录ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.toolStripTextBox_DelCfgFile = new System.Windows.Forms.ToolStripTextBox();
-            this.toolStripTextBox_DelLogFile = new System.Windows.Forms.ToolStripTextBox();
+            this.toolStripTextBox_DelCfgFile = new System.Windows.Forms.ToolStripComboBox();
+            this.toolStripTextBox_DelLogFile = new System.Windows.Forms.ToolStripComboBox();
             this.menuStrip_Set.SuspendLayout();
             this.statusStrip1.SuspendLayout();
             this.groupBox1.SuspendLayout();
@@ -620,6 +620,7 @@ namespace Welling_Motor_Debug_Tool
             this.groupBox15.SuspendLayout();
             this.groupBox14.SuspendLayout();
             this.groupBox13.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_OBC_SpeedLimitAdj)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_OBC_OffTime)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_OBC_WheelAdj)).BeginInit();
             this.groupBox12.SuspendLayout();
@@ -648,7 +649,6 @@ namespace Welling_Motor_Debug_Tool
             this.tabPage_RunInfo.SuspendLayout();
             this.tabPage_DebugInfo.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_OBC_SpeedLimitAdj)).BeginInit();
             this.SuspendLayout();
             // 
             // menuStrip_Set
@@ -686,7 +686,7 @@ namespace Welling_Motor_Debug_Tool
             // 刷新ToolStripMenuItem
             // 
             this.刷新ToolStripMenuItem.Name = "刷新ToolStripMenuItem";
-            this.刷新ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
+            this.刷新ToolStripMenuItem.Size = new System.Drawing.Size(160, 26);
             this.刷新ToolStripMenuItem.Text = "刷新";
             this.刷新ToolStripMenuItem.Click += new System.EventHandler(this.刷新ToolStripMenuItem_Click);
             // 
@@ -695,7 +695,7 @@ namespace Welling_Motor_Debug_Tool
             this.端口号ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
             this.toolStripComboBox_ComNum});
             this.端口号ToolStripMenuItem.Name = "端口号ToolStripMenuItem";
-            this.端口号ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
+            this.端口号ToolStripMenuItem.Size = new System.Drawing.Size(160, 26);
             this.端口号ToolStripMenuItem.Text = "端口号";
             this.端口号ToolStripMenuItem.Click += new System.EventHandler(this.ConfigFileSave_Click);
             // 
@@ -713,7 +713,7 @@ namespace Welling_Motor_Debug_Tool
             this.波特率ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
             this.toolStripComboBox_Baudrate});
             this.波特率ToolStripMenuItem.Name = "波特率ToolStripMenuItem";
-            this.波特率ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
+            this.波特率ToolStripMenuItem.Size = new System.Drawing.Size(160, 26);
             this.波特率ToolStripMenuItem.Text = "波特率";
             // 
             // toolStripComboBox_Baudrate
@@ -732,14 +732,14 @@ namespace Welling_Motor_Debug_Tool
             // 连接ToolStripMenuItem
             // 
             this.连接ToolStripMenuItem.Name = "连接ToolStripMenuItem";
-            this.连接ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
+            this.连接ToolStripMenuItem.Size = new System.Drawing.Size(160, 26);
             this.连接ToolStripMenuItem.Text = "连接";
             this.连接ToolStripMenuItem.Click += new System.EventHandler(this.连接ToolStripMenuItem_Click);
             // 
             // toolStripSeparator1
             // 
             this.toolStripSeparator1.Name = "toolStripSeparator1";
-            this.toolStripSeparator1.Size = new System.Drawing.Size(177, 6);
+            this.toolStripSeparator1.Size = new System.Drawing.Size(157, 6);
             // 
             // 其它配置项ToolStripMenuItem
             // 
@@ -748,7 +748,7 @@ namespace Welling_Motor_Debug_Tool
             this.断开关机ToolStripMenuItem,
             this.识别通讯盒ToolStripMenuItem});
             this.其它配置项ToolStripMenuItem.Name = "其它配置项ToolStripMenuItem";
-            this.其它配置项ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
+            this.其它配置项ToolStripMenuItem.Size = new System.Drawing.Size(160, 26);
             this.其它配置项ToolStripMenuItem.Text = "其它配置项";
             // 
             // 连接开机ToolStripMenuItem
@@ -1240,8 +1240,8 @@ namespace Welling_Motor_Debug_Tool
             this.计算器ToolStripMenuItem,
             this.页面保存ToolStripMenuItem,
             this.屏幕键盘ToolStripMenuItem,
-            this.指令调试ToolStripMenuItem,
-            this.删除远程文件ToolStripMenuItem});
+            this.删除远程文件ToolStripMenuItem,
+            this.指令调试ToolStripMenuItem});
             this.工具箱ToolStripMenuItem.ForeColor = System.Drawing.Color.White;
             this.工具箱ToolStripMenuItem.Name = "工具箱ToolStripMenuItem";
             this.工具箱ToolStripMenuItem.Size = new System.Drawing.Size(70, 25);
@@ -1282,6 +1282,31 @@ namespace Welling_Motor_Debug_Tool
             this.指令调试ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
             this.指令调试ToolStripMenuItem.Text = "指令调试";
             // 
+            // 删除远程文件ToolStripMenuItem
+            // 
+            this.删除远程文件ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.生产配置文件ToolStripMenuItem,
+            this.样机测试记录ToolStripMenuItem});
+            this.删除远程文件ToolStripMenuItem.Name = "删除远程文件ToolStripMenuItem";
+            this.删除远程文件ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
+            this.删除远程文件ToolStripMenuItem.Text = "删除远程文件";
+            // 
+            // 生产配置文件ToolStripMenuItem
+            // 
+            this.生产配置文件ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.toolStripTextBox_DelCfgFile});
+            this.生产配置文件ToolStripMenuItem.Name = "生产配置文件ToolStripMenuItem";
+            this.生产配置文件ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
+            this.生产配置文件ToolStripMenuItem.Text = "生产配置文件";
+            // 
+            // 样机测试记录ToolStripMenuItem
+            // 
+            this.样机测试记录ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.toolStripTextBox_DelLogFile});
+            this.样机测试记录ToolStripMenuItem.Name = "样机测试记录ToolStripMenuItem";
+            this.样机测试记录ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
+            this.样机测试记录ToolStripMenuItem.Text = "样机测试记录";
+            // 
             // 查询ToolStripMenuItem
             // 
             this.查询ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
@@ -2150,6 +2175,16 @@ namespace Welling_Motor_Debug_Tool
             this.tabPage_UsrRideParam.TabIndex = 14;
             this.tabPage_UsrRideParam.Text = "用户骑行参数";
             // 
+            // checkBox_UserRideParam_OBC
+            // 
+            this.checkBox_UserRideParam_OBC.AutoSize = true;
+            this.checkBox_UserRideParam_OBC.Location = new System.Drawing.Point(858, 172);
+            this.checkBox_UserRideParam_OBC.Name = "checkBox_UserRideParam_OBC";
+            this.checkBox_UserRideParam_OBC.Size = new System.Drawing.Size(93, 25);
+            this.checkBox_UserRideParam_OBC.TabIndex = 8;
+            this.checkBox_UserRideParam_OBC.Text = "模拟仪表";
+            this.checkBox_UserRideParam_OBC.UseVisualStyleBackColor = true;
+            // 
             // button_WriteUsrRidetParam
             // 
             this.button_WriteUsrRidetParam.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
@@ -3390,6 +3425,44 @@ namespace Welling_Motor_Debug_Tool
             this.groupBox13.TabStop = false;
             this.groupBox13.Text = "设置用户参数";
             // 
+            // numericUpDown_OBC_SpeedLimitAdj
+            // 
+            this.numericUpDown_OBC_SpeedLimitAdj.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(224)))), ((int)(((byte)(192)))));
+            this.numericUpDown_OBC_SpeedLimitAdj.Location = new System.Drawing.Point(83, 144);
+            this.numericUpDown_OBC_SpeedLimitAdj.Maximum = new decimal(new int[] {
+            20,
+            0,
+            0,
+            0});
+            this.numericUpDown_OBC_SpeedLimitAdj.Minimum = new decimal(new int[] {
+            50,
+            0,
+            0,
+            -2147483648});
+            this.numericUpDown_OBC_SpeedLimitAdj.Name = "numericUpDown_OBC_SpeedLimitAdj";
+            this.numericUpDown_OBC_SpeedLimitAdj.ReadOnly = true;
+            this.numericUpDown_OBC_SpeedLimitAdj.Size = new System.Drawing.Size(51, 28);
+            this.numericUpDown_OBC_SpeedLimitAdj.TabIndex = 15;
+            this.numericUpDown_OBC_SpeedLimitAdj.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+            // 
+            // label80
+            // 
+            this.label80.AutoSize = true;
+            this.label80.Location = new System.Drawing.Point(140, 148);
+            this.label80.Name = "label80";
+            this.label80.Size = new System.Drawing.Size(51, 21);
+            this.label80.TabIndex = 17;
+            this.label80.Text = "km/h";
+            // 
+            // label128
+            // 
+            this.label128.AutoSize = true;
+            this.label128.Location = new System.Drawing.Point(6, 148);
+            this.label128.Name = "label128";
+            this.label128.Size = new System.Drawing.Size(74, 21);
+            this.label128.TabIndex = 16;
+            this.label128.Text = "限速微调";
+            // 
             // label64
             // 
             this.label64.AutoSize = true;
@@ -6590,90 +6663,21 @@ namespace Welling_Motor_Debug_Tool
             this.label46.TabIndex = 21;
             this.label46.Text = "/";
             // 
-            // numericUpDown_OBC_SpeedLimitAdj
-            // 
-            this.numericUpDown_OBC_SpeedLimitAdj.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(224)))), ((int)(((byte)(192)))));
-            this.numericUpDown_OBC_SpeedLimitAdj.Location = new System.Drawing.Point(83, 144);
-            this.numericUpDown_OBC_SpeedLimitAdj.Maximum = new decimal(new int[] {
-            20,
-            0,
-            0,
-            0});
-            this.numericUpDown_OBC_SpeedLimitAdj.Minimum = new decimal(new int[] {
-            50,
-            0,
-            0,
-            -2147483648});
-            this.numericUpDown_OBC_SpeedLimitAdj.Name = "numericUpDown_OBC_SpeedLimitAdj";
-            this.numericUpDown_OBC_SpeedLimitAdj.ReadOnly = true;
-            this.numericUpDown_OBC_SpeedLimitAdj.Size = new System.Drawing.Size(51, 28);
-            this.numericUpDown_OBC_SpeedLimitAdj.TabIndex = 15;
-            this.numericUpDown_OBC_SpeedLimitAdj.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
-            // 
-            // label80
-            // 
-            this.label80.AutoSize = true;
-            this.label80.Location = new System.Drawing.Point(140, 148);
-            this.label80.Name = "label80";
-            this.label80.Size = new System.Drawing.Size(51, 21);
-            this.label80.TabIndex = 17;
-            this.label80.Text = "km/h";
-            // 
-            // label128
-            // 
-            this.label128.AutoSize = true;
-            this.label128.Location = new System.Drawing.Point(6, 148);
-            this.label128.Name = "label128";
-            this.label128.Size = new System.Drawing.Size(74, 21);
-            this.label128.TabIndex = 16;
-            this.label128.Text = "限速微调";
-            // 
-            // checkBox_UserRideParam_OBC
-            // 
-            this.checkBox_UserRideParam_OBC.AutoSize = true;
-            this.checkBox_UserRideParam_OBC.Location = new System.Drawing.Point(858, 172);
-            this.checkBox_UserRideParam_OBC.Name = "checkBox_UserRideParam_OBC";
-            this.checkBox_UserRideParam_OBC.Size = new System.Drawing.Size(93, 25);
-            this.checkBox_UserRideParam_OBC.TabIndex = 8;
-            this.checkBox_UserRideParam_OBC.Text = "模拟仪表";
-            this.checkBox_UserRideParam_OBC.UseVisualStyleBackColor = true;
-            // 
-            // 删除远程文件ToolStripMenuItem
-            // 
-            this.删除远程文件ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
-            this.生产配置文件ToolStripMenuItem,
-            this.样机测试记录ToolStripMenuItem});
-            this.删除远程文件ToolStripMenuItem.Name = "删除远程文件ToolStripMenuItem";
-            this.删除远程文件ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
-            this.删除远程文件ToolStripMenuItem.Text = "删除远程文件";
-            // 
-            // 生产配置文件ToolStripMenuItem
-            // 
-            this.生产配置文件ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
-            this.toolStripTextBox_DelCfgFile});
-            this.生产配置文件ToolStripMenuItem.Name = "生产配置文件ToolStripMenuItem";
-            this.生产配置文件ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
-            this.生产配置文件ToolStripMenuItem.Text = "生产配置文件";
-            // 
-            // 样机测试记录ToolStripMenuItem
-            // 
-            this.样机测试记录ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
-            this.toolStripTextBox_DelLogFile});
-            this.样机测试记录ToolStripMenuItem.Name = "样机测试记录ToolStripMenuItem";
-            this.样机测试记录ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
-            this.样机测试记录ToolStripMenuItem.Text = "样机测试记录";
-            // 
             // toolStripTextBox_DelCfgFile
             // 
-            this.toolStripTextBox_DelCfgFile.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F);
+            this.toolStripTextBox_DelCfgFile.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.toolStripTextBox_DelCfgFile.Name = "toolStripTextBox_DelCfgFile";
-            this.toolStripTextBox_DelCfgFile.Size = new System.Drawing.Size(100, 23);
+            this.toolStripTextBox_DelCfgFile.Size = new System.Drawing.Size(100, 25);
+            this.toolStripTextBox_DelCfgFile.SelectedIndexChanged += new System.EventHandler(this.toolStripTextBox_DelCfgFile_SelectedIndexChanged);
+            this.toolStripTextBox_DelCfgFile.Click += new System.EventHandler(this.toolStripTextBox_DelCfgFile_Click);
             // 
             // toolStripTextBox_DelLogFile
             // 
-            this.toolStripTextBox_DelLogFile.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F);
+            this.toolStripTextBox_DelLogFile.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.toolStripTextBox_DelLogFile.Name = "toolStripTextBox_DelLogFile";
-            this.toolStripTextBox_DelLogFile.Size = new System.Drawing.Size(100, 23);
+            this.toolStripTextBox_DelLogFile.Size = new System.Drawing.Size(100, 25);
+            this.toolStripTextBox_DelLogFile.SelectedIndexChanged += new System.EventHandler(this.toolStripTextBox_DelLogFile_SelectedIndexChanged);
+            this.toolStripTextBox_DelLogFile.Click += new System.EventHandler(this.toolStripTextBox_DelLogFile_Click);
             // 
             // mainForm
             // 
@@ -6764,6 +6768,7 @@ namespace Welling_Motor_Debug_Tool
             this.groupBox14.PerformLayout();
             this.groupBox13.ResumeLayout(false);
             this.groupBox13.PerformLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_OBC_SpeedLimitAdj)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_OBC_OffTime)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_OBC_WheelAdj)).EndInit();
             this.groupBox12.ResumeLayout(false);
@@ -6808,7 +6813,6 @@ namespace Welling_Motor_Debug_Tool
             this.tabPage_DebugInfo.ResumeLayout(false);
             this.tabPage_DebugInfo.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.numericUpDown_OBC_SpeedLimitAdj)).EndInit();
             this.ResumeLayout(false);
             this.PerformLayout();
 
@@ -7369,8 +7373,8 @@ namespace Welling_Motor_Debug_Tool
         private CheckBox checkBox_UserRideParam_OBC;
         private ToolStripMenuItem 删除远程文件ToolStripMenuItem;
         private ToolStripMenuItem 生产配置文件ToolStripMenuItem;
-        private ToolStripTextBox toolStripTextBox_DelCfgFile;
         private ToolStripMenuItem 样机测试记录ToolStripMenuItem;
-        private ToolStripTextBox toolStripTextBox_DelLogFile;
+        private ToolStripComboBox toolStripTextBox_DelCfgFile;
+        private ToolStripComboBox toolStripTextBox_DelLogFile;
     }
 }

+ 170 - 0
Welling_Motor_Debug_Tool/mainForm.cs

@@ -8290,5 +8290,175 @@ namespace Welling_Motor_Debug_Tool
                 MessageBox.Show("数据格式错误!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }
+
+        /// <summary>
+        /// 获取删除配置文件日期列表
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void toolStripTextBox_DelCfgFile_Click(object sender, EventArgs e)
+        {
+            string[] DateList = { "" };
+
+            //网络断开时直接退出
+            if (!myFtp.IsNetConnected)
+                return;
+
+            //从服务器更新日期列表
+            DateList = myFtp.GetDirectoryList(toolStripTextBox_ServerPath.Text + "\\" + localInfo.CfgPathName);
+
+            toolStripTextBox_DelCfgFile.Items.Clear();
+
+            //日期列表加载,显示最近30天
+            if (DateList.Length > 30)
+            {
+                toolStripTextBox_DelCfgFile.Items.Add("30天以前文件无法删除");                
+                toolStripTextBox_DelCfgFile.Items.Add("---");                
+            }
+            for (int i = (DateList.Length > 30) ? (DateList.Length - 30) : 0; i < DateList.Length; i++)//显示最近30个日期
+            {
+                toolStripTextBox_DelCfgFile.Items.Add(DateList[i].Substring(DateList[i].LastIndexOf("\\") + 1));                
+            }
+        }
+
+        /// <summary>
+        /// 删除指定配置文件
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void toolStripTextBox_DelCfgFile_SelectedIndexChanged(object sender, EventArgs e)
+        {
+            //提示输入文件名
+            Scan scan_form = new Scan();
+            scan_form.ShowDialog();
+            do
+            {
+                if (scan_form.textBox_Scan.Text == string.Empty)
+                {
+                    timer_1s.Enabled = false;
+                    MessageBox.Show("无内容!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+                    timer_1s.Enabled = true;
+                    break;
+                }
+                string DelFile = scan_form.textBox_Scan.Text;
+
+                if (MessageBox.Show("确认删除?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
+                {
+                    EnterForm1.ShowDialog();
+                    try
+                    {
+                        if (EnterForm1.textBox_Passwd.Text == EnterForm1.UserAccount[EnterForm1.comboBox_User.Text])//检验模式所有用户支持
+                        {
+                            if (EnterForm1.comboBox_User.Text.Contains("工程"))
+                            {
+                                try
+                                {
+                                    myFtp.DeleteFile(toolStripTextBox_ServerPath.Text + "\\" + localInfo.CfgPathName + "\\" + toolStripTextBox_DelCfgFile.Text + "\\" + DelFile);
+                                    myFtp.DeleteFile(toolStripTextBox_ServerPath.Text + "\\" + localInfo.CfgPathName + "\\" + toolStripTextBox_DelCfgFile.Text + "\\" + Path.GetFileNameWithoutExtension(DelFile) + ".src");
+                                    myFtp.DeleteFile(toolStripTextBox_ServerPath.Text + "\\" + localInfo.CfgPathName + "\\" + toolStripTextBox_DelCfgFile.Text + "\\" + Path.GetFileNameWithoutExtension(DelFile) + ".png");
+                                    MessageBoxTimeOut.Show("删除成功", "提示", 1000, MessageBoxButtons.OK, MessageBoxIcon.Information);
+                                }
+                                catch (Exception)
+                                {
+                                    MessageBoxTimeOut.Show("删除异常", "提示", 1000, MessageBoxButtons.OK, MessageBoxIcon.Error);
+                                }
+                            }
+                            else
+                            {
+                                MessageBoxTimeOut.Show("权限不支持!", "提示", 1000, MessageBoxButtons.OK, MessageBoxIcon.Error);
+                            }
+                        }
+                    }
+                    catch (Exception)
+                    {
+                        MessageBoxTimeOut.Show("用户不存在或密码错误!", "提示", 1000, MessageBoxButtons.OK, MessageBoxIcon.Error);
+                    }
+                }
+            } while (false);
+        }
+
+        /// <summary>
+        /// 获取删除样机测试记录日期列表
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void toolStripTextBox_DelLogFile_Click(object sender, EventArgs e)
+        {
+            string[] DateList = { "" };
+
+            //网络断开时直接退出
+            if (!myFtp.IsNetConnected)
+                return;
+
+            //从服务器更新日期列表
+            DateList = myFtp.GetDirectoryList(toolStripTextBox_ServerPath.Text + "\\" + localInfo.SampleFileName);
+
+            toolStripTextBox_DelLogFile.Items.Clear();
+
+            //日期列表加载,显示最近30天
+            if (DateList.Length > 30)
+            {
+                toolStripTextBox_DelLogFile.Items.Add("30天以前文件无法删除");
+                toolStripTextBox_DelLogFile.Items.Add("---");
+            }
+            for (int i = (DateList.Length > 30) ? (DateList.Length - 30) : 0; i < DateList.Length; i++)//显示最近30个日期
+            {
+                toolStripTextBox_DelLogFile.Items.Add(DateList[i].Substring(DateList[i].LastIndexOf("\\") + 1));
+            }
+        }
+
+        /// <summary>
+        /// 删除指定的样机测试记录
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void toolStripTextBox_DelLogFile_SelectedIndexChanged(object sender, EventArgs e)
+        {
+            //提示输入文件名
+            Scan scan_form = new Scan();
+            scan_form.ShowDialog();
+            do
+            {
+                if (scan_form.textBox_Scan.Text == string.Empty)
+                {
+                    timer_1s.Enabled = false;
+                    MessageBox.Show("无内容!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+                    timer_1s.Enabled = true;
+                    break;
+                }
+                string DelFile = scan_form.textBox_Scan.Text;
+
+                if (MessageBox.Show("确认删除?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
+                {
+                    EnterForm1.ShowDialog();
+                    try
+                    {
+                        if (EnterForm1.textBox_Passwd.Text == EnterForm1.UserAccount[EnterForm1.comboBox_User.Text])//检验模式所有用户支持
+                        {
+                            if (EnterForm1.comboBox_User.Text.Contains("工程"))
+                            {
+                                try
+                                {
+                                    myFtp.RemoveDirectory(toolStripTextBox_ServerPath.Text + "\\" + localInfo.SampleFileName + "\\" + toolStripTextBox_DelLogFile.Text + "\\" + DelFile);                                    
+                                    MessageBoxTimeOut.Show("删除成功", "提示", 1000, MessageBoxButtons.OK, MessageBoxIcon.Information);
+                                }
+                                catch (Exception)
+                                {
+                                    MessageBoxTimeOut.Show("删除异常", "提示", 1000, MessageBoxButtons.OK, MessageBoxIcon.Error);
+                                }
+                            }
+                            else
+                            {
+                                MessageBoxTimeOut.Show("权限不支持!", "提示", 1000, MessageBoxButtons.OK, MessageBoxIcon.Error);
+                            }
+                        }
+                    }
+                    catch (Exception)
+                    {
+                        MessageBoxTimeOut.Show("用户不存在或密码错误!", "提示", 1000, MessageBoxButtons.OK, MessageBoxIcon.Error);
+                    }
+                }
+            } while (false);
+        }
     }
 }

BIN
Welling_Motor_Debug_Tool/obj/Debug/Welling_Motor_Debug_Tool.csproj.GenerateResource.cache


BIN
Welling_Motor_Debug_Tool/obj/Debug/Welling_Motor_Debug_Tool.exe


BIN
Welling_Motor_Debug_Tool/obj/Debug/Welling_Motor_Debug_Tool.pdb