I'm having trouble with getting the uptodate amount of files in a directory. The files are being printed from PDFCreator and being sent to that folder. When the number of files in the folder match the number of files being printed it should then break and continue with my code. The problem is the count doesn't keep uptodate and I do not know how to refresh it. This is my code:
System.IO.DirectoryInfo pdf = new System.IO.DirectoryInfo(@"C:\0TeklaBatchProcess\pdf");
int count = pdf.GetFiles().Length;
while (count != DE.GetSize())
{
if (count < DE.GetSize())
{
pdf.Refresh();
}
else
{
break;
}
}
If someone can tell me how to refresh or update the count of files I'd appreciate it a lot.