|
@@ -90,7 +90,7 @@ namespace FileWatcher
|
|
|
InitDB = new Thread(ConnectDB);
|
|
|
//添加监控事件
|
|
|
XmlWatcher.Changed += new FileSystemEventHandler(XmlWatcher_Created);
|
|
|
- ATEFile.Changed += new FileSystemEventHandler(XmlWatcher_Created);
|
|
|
+ //ATEFile.Changed += new FileSystemEventHandler(XmlWatcher_Created);
|
|
|
SetLoadingWindow stw = new SetLoadingWindow(InitDB, "正在启动程序");
|
|
|
stw.StartPosition = FormStartPosition.CenterScreen;
|
|
|
stw.ShowDialog();
|
|
@@ -147,9 +147,9 @@ namespace FileWatcher
|
|
|
XmlWatcher.Path = FolderPath.Text;
|
|
|
XmlWatcher.EnableRaisingEvents = true;
|
|
|
XmlWatcher.NotifyFilter = NotifyFilters.FileName | NotifyFilters.LastWrite;
|
|
|
- ATEFile.Path = FolderPath.Text;
|
|
|
- ATEFile.EnableRaisingEvents = true;
|
|
|
- ATEFile.NotifyFilter = NotifyFilters.FileName | NotifyFilters.LastWrite;
|
|
|
+ //ATEFile.Path = FolderPath.Text;
|
|
|
+ //ATEFile.EnableRaisingEvents = true;
|
|
|
+ //ATEFile.NotifyFilter = NotifyFilters.FileName | NotifyFilters.LastWrite;
|
|
|
//设置缓存数据
|
|
|
BaseUtil.SetCacheData("FolderPath", FolderPath.Text);
|
|
|
BaseUtil.SetCacheData("Device", Device.Text);
|
|
@@ -157,7 +157,7 @@ namespace FileWatcher
|
|
|
//BaseUtil.SetCacheData("BackUpFolderPath", BackUpFolderPath.Text);
|
|
|
//BaseUtil.SetCacheData("Master", Master.Text);
|
|
|
//BaseUtil.SetCacheData("AutoStart", AutoStart.Checked);
|
|
|
- Timer.Interval = 1000 * 10;
|
|
|
+ Timer.Interval = 1000 * 60;
|
|
|
Timer.Start();
|
|
|
//设置按钮不可点击
|
|
|
StartWatch.Enabled = false;
|
|
@@ -256,6 +256,9 @@ namespace FileWatcher
|
|
|
}
|
|
|
else if (Device.Text == "ATE设备")
|
|
|
{
|
|
|
+ if (!FileName.Contains("ATE日志文件")) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
StreamReader sR = new StreamReader(FileName, Encoding.Default);
|
|
|
Console.WriteLine(sR.CurrentEncoding);
|
|
|
DataTable filedt = new DataTable();
|
|
@@ -426,11 +429,11 @@ namespace FileWatcher
|
|
|
|
|
|
private void Timer_Tick(object sender, EventArgs e)
|
|
|
{
|
|
|
- //var AllXmls = Directory.GetFiles(FolderPath.Text, "*.txt");
|
|
|
- //foreach (var Xml in AllXmls)
|
|
|
- //{
|
|
|
- // TxtHandleProcess(Xml);
|
|
|
- //}
|
|
|
+ var AllXmls = Directory.GetFiles(FolderPath.Text, "*.txt");
|
|
|
+ foreach (var Xml in AllXmls)
|
|
|
+ {
|
|
|
+ TxtHandleProcess(Xml);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/// <summary>
|