I want to check if file is recently modified. If the file is modified then only do the following: (If the file is not modified then don't do anything.)
How can I achieve that?
if (lastLine.Contains("SFTP") || lastLine.Contains("ERROR"))
{
if (listBox2.InvokeRequired)
{
listBox2.Invoke(new MethodInvoker(delegate
{
listBox2.Items.Add(lastLine);
}
));
}
}
Thread.Sleep(5000);