T
Tony
I have setup a FileSystemWatcher to fire an event when the specified file is
modified.
But the event never fires for some reason and the file is being modified.
I have pasted the setup code below. I must be doing something wrong (I have
verified the file names and path as being correct).
Tony
m_oFileSystemWatcher = new
FileSystemWatcher();
m_oFileSystemWatcher.NotifyFilter =
NotifyFilters.LastWrite;
m_oFileSystemWatcher.Path =
Path.GetDirectoryName(sLocalFilename);
m_oFileSystemWatcher.Filter =
Path.GetFileName(sLocalFilename);
m_oFileSystemWatcher.Changed += new
FileSystemEventHandler(OnFileSystemWatcher_Changed);
m_oFileSystemWatcher.EnableRaisingEvents = true;
private void OnFileSystemWatcher_Changed(object sender,
FileSystemEventArgs e)
{
m_bFileModified = true;
}
modified.
But the event never fires for some reason and the file is being modified.
I have pasted the setup code below. I must be doing something wrong (I have
verified the file names and path as being correct).
Tony
m_oFileSystemWatcher = new
FileSystemWatcher();
m_oFileSystemWatcher.NotifyFilter =
NotifyFilters.LastWrite;
m_oFileSystemWatcher.Path =
Path.GetDirectoryName(sLocalFilename);
m_oFileSystemWatcher.Filter =
Path.GetFileName(sLocalFilename);
m_oFileSystemWatcher.Changed += new
FileSystemEventHandler(OnFileSystemWatcher_Changed);
m_oFileSystemWatcher.EnableRaisingEvents = true;
private void OnFileSystemWatcher_Changed(object sender,
FileSystemEventArgs e)
{
m_bFileModified = true;
}