|
|
@@ -104,7 +104,6 @@ namespace FileWatcher
|
|
|
FormBorderStyle = FormBorderStyle.FixedSingle;
|
|
|
InitDB = new Thread(ConnectDB);
|
|
|
//添加监控事件
|
|
|
- //XmlWatcher.Created += new FileSystemEventHandler(XmlWatcher_Created);
|
|
|
SetLoadingWindow stw = new SetLoadingWindow(InitDB, "正在启动程序");
|
|
|
stw.StartPosition = FormStartPosition.CenterScreen;
|
|
|
stw.ShowDialog();
|
|
|
@@ -183,7 +182,10 @@ namespace FileWatcher
|
|
|
BaseUtil.SetCacheData("MachineType", MachineType.Text);
|
|
|
BaseUtil.SetCacheData("Device", Device.Text);
|
|
|
//BaseUtil.SetCacheData("AutoStart", AutoStart.Checked);
|
|
|
-
|
|
|
+ if (Device.Text != "SPI")
|
|
|
+ {
|
|
|
+ XmlWatcher.Created += new FileSystemEventHandler(XmlWatcher_Created);
|
|
|
+ }
|
|
|
Timer.Interval = 1000 * int.Parse(TimerInter.Text.ToString());
|
|
|
Timer.Start();
|
|
|
//设置按钮不可点击
|
|
|
@@ -463,22 +465,22 @@ namespace FileWatcher
|
|
|
|
|
|
private void Timer_Tick(object sender, EventArgs e)
|
|
|
{
|
|
|
- if (deleteFile.Checked)
|
|
|
- {
|
|
|
- var AllXmls = Directory.GetFiles(FolderPath.Text, "*.*", SearchOption.AllDirectories).Where(s => s.ToUpper().EndsWith(".TXT") || s.ToUpper().EndsWith(".INI"));
|
|
|
- foreach (var Xml in AllXmls)
|
|
|
- {
|
|
|
- try
|
|
|
- {
|
|
|
- TxtHandleProcess(Xml.ToString());
|
|
|
- File.Delete(Xml.ToString());
|
|
|
- }
|
|
|
- catch (Exception ex)
|
|
|
- {
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ //if (deleteFile.Checked)
|
|
|
+ //{
|
|
|
+ // var AllXmls = Directory.GetFiles(FolderPath.Text, "*.*", SearchOption.AllDirectories).Where(s => s.ToUpper().EndsWith(".TXT") || s.ToUpper().EndsWith(".INI"));
|
|
|
+ // foreach (var Xml in AllXmls)
|
|
|
+ // {
|
|
|
+ // try
|
|
|
+ // {
|
|
|
+ // TxtHandleProcess(Xml.ToString());
|
|
|
+ // File.Delete(Xml.ToString());
|
|
|
+ // }
|
|
|
+ // catch (Exception ex)
|
|
|
+ // {
|
|
|
+
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ //}
|
|
|
}
|
|
|
|
|
|
private void CleanFolderPath_Click(object sender, EventArgs e)
|