こんにちは。
3~4年前にWindows7上でFileSystemWatcherを使ってあるフォルダに映像が転送完了したら
プレイヤーで再生するというアプリケーションをC#で開発しました。
ところがパナソニックのタフブックCF-C2にそのアプリを
コピーして動作させてもFileSystemWatcher関連のイベントが一切発生せず
期待通りの動作がしません。
ちなみにQt5.7で似たようなアプリケーションをC++で開発しましたが
このタフブックでは正常にイベントが飛んできました。
タフブックのOSはWindows8.1です。
最近の開発マシンのWindows10では正常に動作しました。
他の処理が悪さしているのかと思ってFileSystemWatcherの部分だけにしぼった
コードにしてもイベントが飛んできません。
これはOSの問題なんでしょうか?
それともマシン固有の問題なんでしょうか?
C#のFileSystemWatcherの動作を阻害するドライバーとかあるのでしょうか?
FileSystemWatcher関連の動作に必要な前提とかありますでしょうか?
参考までにC#コードの一部を掲載しておきます。
this.CurrentFileSystemWatcher.Path = txtMovieFolder.Text;
this.CurrentFileSystemWatcher.EnableRaisingEvents = true;
this.CurrentFileSystemWatcher.SynchronizingObject = this;
this.CurrentFileSystemWatcher.Changed += new System.IO.FileSystemEventHandler(this.CurrentFileSystemWatcher_Changed);
this.CurrentFileSystemWatcher.Created += new System.IO.FileSystemEventHandler(this.CurrentFileSystemWatcher_Created);
this.CurrentFileSystemWatcher.Renamed += new System.IO.RenamedEventHandler(this.CurrentFileSystemWatcher_Renamed);
this.CurrentFileSystemWatcher.NotifyFilter = NotifyFilters.LastAccess | NotifyFilters.LastWrite | NotifyFilters.FileName | NotifyFilters.DirectoryName | NotifyFilters.CreationTime;
this.CurrentFileSystemWatcher.IncludeSubdirectories = false;
以上よろしくお願いします。