i need to watch a folder that are inside my ios/android application.
I would like to use FileSystemWatcher
.
This is my code:
var DocFolder = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
var InboxFolder = DocFolder + "/Inbox";
FileSystemWatcher watcher = new FileSystemWatcher() {
Path = InboxFolder,
NotifyFilter = NotifyFilters.LastAccess | NotifyFilters.LastWrite | NotifyFilters.FileName | NotifyFilters.DirectoryName,
Filter = "*.*",
EnableRaisingEvents = true
};
watcher.Created += (object sender, FileSystemEventArgs e) => {
// do stuff
};
When the FileSystemWatcher
is initializated this error is triggered:
System.NotImplementedException: The method or operation is not implemented.
How can I make this works?
There is another way to watch a folder?
Thank you!