2
schangxiang@126.com
2024-06-24 ec579e2c851960d59bda3f201a1eae3f6ca0935b
DataCapture/iWare_SCADA_DataCapture/iWare_SCADA_FormTest/Form1.cs
@@ -9,6 +9,7 @@
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.TaskbarClock;
namespace iWare_SCADA_FormTest
{
@@ -43,5 +44,29 @@
            }
        }
        private void button2_Click(object sender, EventArgs e)
        {
            try
            {
                string path = ConfigHelper.GetConfigString("OP60QualityData_Test");
                var newFiles = FileHelper.DetectNewFiles(path, "*.dfq", 300, DateTime.Now.AddDays(-100), DateTime.Now.AddDays(1));
                foreach (System.IO.FileInfo file in newFiles)
                {
                    //MessageBox.Show("找到文件:" + file.FullName);
                    var toPath = file.FullName.Replace("Measuring_Data_df_Test", "Measuring_Data_df_Copy");
                    //MessageBox.Show("要移动到:" + file.FullName);
                    File.Move(file.FullName, toPath);//移动
                }
                MessageBox.Show("成功");
            }
            catch (Exception ex)
            {
                MessageBox.Show("异常:" + ex.Message);
            }
        }
    }
}