hi!
to put it simply...
the filesystemwatcher does not fire its events...
i wrote a very simple application to test this:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Airkom.Guard.MobileClient.Utilities;
using OpenNETCF.IO;
namespace filesystemwatchertest
{
public partial class Form1 : Form
{
private FileSystemWatcher fsw;
public Form1()
{
InitializeComponent();
//--> \Programme\filesystemwatchertest
textBox1.Text = EnviromentTools.ApplicationPath;
}
void fsw_Deleted(object sender, FileSystemEventArgs e)
{
WatcherChangeTypes wct = e.ChangeType;
}
void fsw_Created(object sender, FileSystemEventArgs e)
{
WatcherChangeTypes wct = e.ChangeType;
}
void fsw_Changed(object sender, FileSystemEventArgs e)
{
WatcherChangeTypes wct = e.ChangeType;
}
private void button1_Click(object sender, EventArgs e)
{
fsw = new FileSystemWatcher(textBox1.Text, "*.*");
fsw.IncludeSubdirectories = true;
fsw.NotifyFilter = NotifyFilters.LastAccess | NotifyFilters.LastWrite |
NotifyFilters.FileName | NotifyFilters.DirectoryName;
fsw.Changed += new FileSystemEventHandler(fsw_Changed);
fsw.Created += new FileSystemEventHandler(fsw_Created);
fsw.Deleted += new FileSystemEventHandler(fsw_Deleted);
fsw.EnableRaisingEvents = true;
}
private void menuItem1_Click(object sender, EventArgs e)
{
this.Close();
}
}
}
i test by using active sync to copy files in the directory or delete them...
when copying a file in the directory it does nothing...
when deleting the file, the OnDeleted event is thrown as wanted...
he does throw its events if i limit it to *.txt copy a txt file in the directory (nothing happens) and edit it with the editor...
does anybody has the same problem or may help me?
thx