Hello I've runned in to a problem again that I can't solve on my own.
I have a FileSystemWatcher
named filOvervakare
and uses this code to trigger a method.
filOvervakare.NotifyFilter = NotifyFilters.Size;
filOvervakare.NotifyFilter = NotifyFilters.LastWrite;
filOvervakare.Changed += new FileSystemEventHandler(filOvervakare_Changed);
This is the method:
void filOvervakare_Changed(object sender, FileSystemEventArgs e)
{
if (MessageBox.Show("Vill du ladda upp filen " + e.Name + "?", "En fil har ändrats", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
//code code code
}
}
Everytime a file is changed it is supposed to show the messagebox once. The problem is that instead of getting one messagebox it pops up like 5-6 of them and I have no idea how to fix this and I hope some of you might have a good solution. :)
Thanks!
// Morgan