解决方案 »

  1.   

    这个估计不行。。坐等别人回复虽然没研究过fileSystemWatcher的原理,但总觉得这个应该是基于底层IO事件的
      

  2.   

    http://blog.csdn.net/hwt0101/article/details/8469285
      

  3.   

    var _watcher = new FileSystemWatcher();
    _watcher.Path = @"\\10.31.2.221\shared\";
    _watcher.NotifyFilter = NotifyFilters.LastWrite | NotifyFilters.FileName;
    _watcher.Filter = "*.txt";
    _watcher.Created += new FileSystemEventHandler((x, y) =>Console.WriteLine("Created"));
    _watcher.Error += new ErrorEventHandler( (x, y) =>Console.WriteLine("Error"));
    _watcher.EnableRaisingEvents = true;
    Console.ReadKey();代码来自http://stackoverflow.com/questions/11219373/filesystemwatcher-to-watch-unc-path运行程序的帐号需要一定的权限。一般是域用户,在本机和服务器目录都有权限才可以。