From 21d56e87bf097aadc34a4c55e7ada89da2d3390a Mon Sep 17 00:00:00 2001 From: minhe7735 <61667570+minhe7735@users.noreply.github.com> Date: Thu, 28 Oct 2021 17:18:25 -0400 Subject: [PATCH 1/2] google drive fix? --- AssistantComputerControl/MainProgram.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/AssistantComputerControl/MainProgram.cs b/AssistantComputerControl/MainProgram.cs index 46469a5..46ca593 100644 --- a/AssistantComputerControl/MainProgram.cs +++ b/AssistantComputerControl/MainProgram.cs @@ -265,9 +265,10 @@ public enum TestStatus { Path = CheckPath(), NotifyFilter = NotifyFilters.LastAccess | NotifyFilters.LastWrite | NotifyFilters.FileName | NotifyFilters.DirectoryName, - Filter = "*." + Properties.Settings.Default.ActionFileExtension, + Filter = "*" + Properties.Settings.Default.ActionFileExtension, EnableRaisingEvents = true }; + watcher.IncludeSubdirectories = true; watcher.Changed += new FileSystemEventHandler(new ActionChecker().FileFound); watcher.Created += new FileSystemEventHandler(new ActionChecker().FileFound); watcher.Renamed += new RenamedEventHandler(new ActionChecker().FileFound); @@ -555,7 +556,7 @@ var watcher public static void SetupListener() { watcher.Path = CheckPath(); - watcher.Filter = "*." + Properties.Settings.Default.ActionFileExtension; + watcher.Filter = "*" + Properties.Settings.Default.ActionFileExtension; TaskSchedulerSetup(); DoDebug("Listener modified"); } From 162cc1ae559600184415a58e218a876f6ab1ec0e Mon Sep 17 00:00:00 2001 From: minhe7735 <61667570+minhe7735@users.noreply.github.com> Date: Thu, 28 Oct 2021 17:18:27 -0400 Subject: [PATCH 2/2] google drive fix? --- AssistantComputerControl/actionChecker.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/AssistantComputerControl/actionChecker.cs b/AssistantComputerControl/actionChecker.cs index 3862097..a4ccb79 100644 --- a/AssistantComputerControl/actionChecker.cs +++ b/AssistantComputerControl/actionChecker.cs @@ -117,7 +117,10 @@ public struct BY_HANDLE_FILE_INFORMATION { [STAThread] public void FileFound(object source, FileSystemEventArgs e) { - ProcessFile(e.FullPath); + var extension = Path.GetExtension(e.FullPath).ToUpper(); + if (extension == Properties.Settings.Default.ActionFileExtension.ToUpper()) { + ProcessFile(e.FullPath); + } } [STAThread]