gpt4 book ai didi

c# - FileSystemWatcher 两次引发事件

转载 作者:太空宇宙 更新时间:2023-11-03 13:35:36 26 4
gpt4 key购买 nike

<分区>

public void startWatch()
{
FileSystemWatcher watcher = new FileSystemWatcher();
watcher.Path = Path.GetDirectoryName(_file);
watcher.Filter = Path.GetFileName(_file);
watcher.NotifyFilter = NotifyFilters.LastWrite;
watcher.Changed += watcher_Changed;
watcher.EnableRaisingEvents = true;
}

public void watcher_Changed(object sender, FileSystemEventArgs e)
{
// Jump twice
}

为什么我的文本文件更改后此事件跳转两次?

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com