I want to poll a directory for files every 5 minutes. I do NOT want to use filesystemwatcher. I am fairly new to c# and I cant find any good examples
This is what I have so far. Do I just put this in a timer?
string watchFolder = ConfigurationManager.AppSettings["watchFolder"];
DirectoryInfo directoryInfo = new DirectoryInfo(watchFolder);
if (!Directory.Exists(watchFolder))
{
Console.WriteLine(
"{0} directory does not exist. Please modify the config file accordingly.",
watchFolder);
Environment.Exit(3);
}
FileInfo[] lastUpdatedFiles = directoryInfo.GetFiles();