使用 FileSystemWatcher 监视指定目录中的更改.可监视指定目录中的文件或子目录的更改. 以下是一个简单的实例,用来监控指定目录下文件的新增.删除.重命名等情况(文件内容更改会触发多次,还未想到更好的办法). class Program { static void Main(string[] args) { FileSystemWatcher w = new FileSystemWatcher(@"C:\test"); //给定监控目录,实例化监控类 w.NotifyFi
using FtpLib; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Diagnostics; using System.IO; using System.Linq; using System.ServiceProcess; using System.Text; using System.Threading; using