|
@@ -7,6 +7,8 @@ using YSAI.Core.@interface;
|
|
|
using YSAI.Unility;
|
|
using YSAI.Unility;
|
|
|
using static YSAI.DaqManage.DaqManageData;
|
|
using static YSAI.DaqManage.DaqManageData;
|
|
|
using YSAI.Core.@enum;
|
|
using YSAI.Core.@enum;
|
|
|
|
|
+using Microsoft.Extensions.FileSystemGlobbing;
|
|
|
|
|
+
|
|
|
namespace YSAI.DaqManage
|
|
namespace YSAI.DaqManage
|
|
|
{
|
|
{
|
|
|
/// <summary>
|
|
/// <summary>
|
|
@@ -165,11 +167,22 @@ namespace YSAI.DaqManage
|
|
|
//检索
|
|
//检索
|
|
|
Search();
|
|
Search();
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
//文件夹监控
|
|
//文件夹监控
|
|
|
watcherLibFolder = new FileSystemWatcher(basics.LibFolder);
|
|
watcherLibFolder = new FileSystemWatcher(basics.LibFolder);
|
|
|
//监控的配置
|
|
//监控的配置
|
|
|
watcherLibFolder.Filter = basics.DllWatcherFormat;
|
|
watcherLibFolder.Filter = basics.DllWatcherFormat;
|
|
|
|
|
+ // 设置监控类型
|
|
|
|
|
+ watcherLibFolder.NotifyFilter =
|
|
|
|
|
+ NotifyFilters.FileName | //文件的名称
|
|
|
|
|
+ NotifyFilters.DirectoryName | //目录名
|
|
|
|
|
+ NotifyFilters.Attributes | //文件或文件夹的属性
|
|
|
|
|
+ NotifyFilters.Size | //文件或文件夹的大小
|
|
|
|
|
+ NotifyFilters.LastWrite | //文件或文件夹最后写入内容的日期
|
|
|
|
|
+ NotifyFilters.LastAccess | //文件或文件夹最后被打开的日期
|
|
|
|
|
+ NotifyFilters.CreationTime | //创建文件或文件夹的时间
|
|
|
|
|
+ NotifyFilters.Security; //文件或文件夹的安全设置
|
|
|
//当文件夹中新增文件
|
|
//当文件夹中新增文件
|
|
|
watcherLibFolder.Created += delegate (object sender, FileSystemEventArgs e) { Watcher_Created(sender, e, 0); };
|
|
watcherLibFolder.Created += delegate (object sender, FileSystemEventArgs e) { Watcher_Created(sender, e, 0); };
|
|
|
//当文件夹中删除文件
|
|
//当文件夹中删除文件
|
|
@@ -178,10 +191,21 @@ namespace YSAI.DaqManage
|
|
|
watcherLibFolder.EnableRaisingEvents = true;
|
|
watcherLibFolder.EnableRaisingEvents = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
//文件夹监视
|
|
//文件夹监视
|
|
|
watcherLibConfigFolder = new FileSystemWatcher(basics.LibConfigFolder);
|
|
watcherLibConfigFolder = new FileSystemWatcher(basics.LibConfigFolder);
|
|
|
//监控的配置
|
|
//监控的配置
|
|
|
watcherLibConfigFolder.Filter = basics.ConfigWatcherFormat;
|
|
watcherLibConfigFolder.Filter = basics.ConfigWatcherFormat;
|
|
|
|
|
+ // 设置监控类型
|
|
|
|
|
+ watcherLibConfigFolder.NotifyFilter =
|
|
|
|
|
+ NotifyFilters.FileName | //文件的名称
|
|
|
|
|
+ NotifyFilters.DirectoryName | //目录名
|
|
|
|
|
+ NotifyFilters.Attributes | //文件或文件夹的属性
|
|
|
|
|
+ NotifyFilters.Size | //文件或文件夹的大小
|
|
|
|
|
+ NotifyFilters.LastWrite | //文件或文件夹最后写入内容的日期
|
|
|
|
|
+ NotifyFilters.LastAccess | //文件或文件夹最后被打开的日期
|
|
|
|
|
+ NotifyFilters.CreationTime | //创建文件或文件夹的时间
|
|
|
|
|
+ NotifyFilters.Security; //文件或文件夹的安全设置
|
|
|
//当文件夹中新增文件
|
|
//当文件夹中新增文件
|
|
|
watcherLibConfigFolder.Created += delegate (object sender, FileSystemEventArgs e) { Watcher_Created(sender, e, 1); };
|
|
watcherLibConfigFolder.Created += delegate (object sender, FileSystemEventArgs e) { Watcher_Created(sender, e, 1); };
|
|
|
//当文件夹中删除文件
|
|
//当文件夹中删除文件
|