110,538
社区成员
发帖
与我相关
我的任务
分享
using System;
using System.IO;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
var fw = new FileSystemWatcher
{
Path = "c:\\临时",
Filter = "a.txt",
NotifyFilter = NotifyFilters.LastWrite,
EnableRaisingEvents = true
};
fw.Changed += fw_Changed;
Console.Read();
}
static void fw_Changed(object sender, FileSystemEventArgs e) { Console.WriteLine(e.FullPath); }
}
}