i know this code dont work but is describes good what im trying to do, i want to run the code inside the if check when Lastwritetime is greater then oldvalue date.
private void timer1_Tick(object sender, EventArgs e)
{
DateTime lastWriteTime = File.GetLastWriteTime(@"C:\temp\test_folder\TestFile.txt");
if (lastWriteTime.ToString() > oldValue.ToString())
{
MessageBox.Show("Succsess");
}
string oldValue = lastWriteTime.ToString();
}
edit: im not using SystemfileWatcher because of the mulitple events raised on change.