FileSystemWatcher fsw = new FileSystemWatcher();
fsw.Path = @"C:\foo.txt";
fsw.Changed += new FileSystemEventHandler(LogFileChanged);
private void LogFileChanged(object s, FileSystemEventArgs e)
{
}
如果我在LogFileChanged()
將斷點 - >打開並編輯foo.txt
- >保存文件,斷點不打。有人可以解釋我錯過了什麼嗎?FileSystemWatcher的更改不會觸發事件
哪裏是斷點? –
@ LogFileChanged方法中的@dtryon – Johan
您是否試圖添加System.Diagnostics.Debugger.Launch();而不是斷點?至少可以證明它不是附件問題。 –