|
|
@ -334,7 +334,11 @@ namespace Txgy.FilesWatcher.ViewModels
|
|
|
|
DateTime lastWriteTime = File.GetLastWriteTime(e.FullPath);
|
|
|
|
DateTime lastWriteTime = File.GetLastWriteTime(e.FullPath);
|
|
|
|
watcher.EnableRaisingEvents = false;
|
|
|
|
watcher.EnableRaisingEvents = false;
|
|
|
|
Debug.WriteLine($"最后修改时间:{lastWriteTime}");
|
|
|
|
Debug.WriteLine($"最后修改时间:{lastWriteTime}");
|
|
|
|
string lastLine = File.ReadAllLines(e.FullPath).Last();
|
|
|
|
string lastLine = File.ReadAllLines(e.FullPath).Last().Trim();
|
|
|
|
|
|
|
|
var str= dataList.Where(f => f.Data == lastLine).FirstOrDefault();
|
|
|
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(lastLine)
|
|
|
|
|
|
|
|
&& str==null)
|
|
|
|
|
|
|
|
{
|
|
|
|
System.Windows.Application.Current.Dispatcher.BeginInvoke(new Action(() =>
|
|
|
|
System.Windows.Application.Current.Dispatcher.BeginInvoke(new Action(() =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
DataList.Add(new WatcherFileModel
|
|
|
|
DataList.Add(new WatcherFileModel
|
|
|
@ -356,6 +360,7 @@ namespace Txgy.FilesWatcher.ViewModels
|
|
|
|
string jsonStr = JsonSerializer.Serialize(cSDevicePublish);
|
|
|
|
string jsonStr = JsonSerializer.Serialize(cSDevicePublish);
|
|
|
|
_websocketClient.SendMes(jsonStr);
|
|
|
|
_websocketClient.SendMes(jsonStr);
|
|
|
|
}));
|
|
|
|
}));
|
|
|
|
|
|
|
|
}
|
|
|
|
watcher.EnableRaisingEvents = true;
|
|
|
|
watcher.EnableRaisingEvents = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|