schangxiang@126.com
2024-06-15 2b03b9a1007c5fe0e90d663fba86b088d6894e3b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using iWare_SCADA_BusinessLogical.Utils;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
 
namespace iWare_SCADA_FormTest
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
 
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                string path = ConfigHelper.GetConfigString("OP80QualityData_Test");//OP80的地址
 
                var newFiles = FileHelper.DetectNewFilesCSV(path, 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("CA4GC20TD_Test", "CA4GC20TD_COPY");
                    MessageBox.Show("要移动到:" + file.FullName);
                    File.Move(file.FullName, toPath);//移动
                }
 
                MessageBox.Show("成功");
            }
            catch (Exception ex)
            {
                MessageBox.Show("异常:" + ex.Message);
            }
 
        }
    }
}