private void button1_Click(object sender, System.EventArgs e)
{
    FileSystemWatcher mywatch= new FileSystemWatcher(); mywatch.Path="f:\\";

//the file that is watched is what type
mywatch.Filter="*.doc";
//add event
mywatch.Renamed+=new RenamedEventHandler(this.rename_do);
mywatch.Changed+=new FileSystemEventHandler(this.change_do);

//start watch
mywatch.EnableRaisingEvents=true;
}
private void rename_do(object sender, System.IO.RenamedEventArgs e)
{
MessageBox.Show(e.OldName .ToString()+" 已改变! ","rename提示");

MessageBox.Show(e.FullPath.ToString()+" 已改变! ","rename提示");

MessageBox.Show(e.Name.ToString()+" 已改变! ","rename提示");
} private void change_do(object sender, System.IO.FileSystemEventArgs e)
{
string s=e.Name.ToString();
s=s.Replace("~$","");
if(s=="1.doc")
  MessageBox.Show(e.FullPath.ToString()+" 已改变! ","chang提示");
}