日期:2014-05-17 浏览次数:20784 次
var fileWatcher = new FileSystemWatcher(Path.GetDirectoryName(logFlxLM), "*.log"))
//要监视的属性
fileWatcher.NotifyFilter = NotifyFilters.Size
------解决方案--------------------
NotifyFilters.FileName
------解决方案--------------------
NotifyFilters.DirectoryName
------解决方案--------------------
NotifyFilters.LastWrite;
fileWatcher.Changed += new FileSystemEventHandler(LogFiles_OnChanged);
fileWatcher.Deleted += new FileSystemEventHandler(LogFiles_OnDeleted);
fileWatcher.EnableRaisingEvents = true; //开启监视文件变动