filesystemwatcher changed event twice code example
Example: c# filesystemwatcher double events
//Inside the OnChanged Method
void OnChanged(object source, FileSystemEventArgs e)
{
DateTime lastWriteTime = File.GetLastWriteTime(@"PathToCheck");
if (lastWriteTime != lastRead)
{
if (File.Exists(destPath))
{
File.Delete(destPath);
}
File.Move(sourcePath, destPath);
lastRead = lastWriteTime;
}
}