Taking Hilgreths answer made the code better however the actual problem was a variable data type , changing the type from string to bool to allow for files with no data fixed the issue .
Can't seem to find an answer to this on here or other forums just wondering if there is a way to ignore files of length 0 .
My program is searching through a DIR and returning all the files , I then want to search through the dir and find the most recent file , if a file length is 0 i want to skip to the next file but the system keeps crashing , my code so far looks like
if(fileinfo.Length > 0)
{
GetLatestWritenFileFileInDirectory(directoryInfo, keywordEH, keywordINTER, keywordM&M);
}
else if(result.Length == 0)
{
}
very rough at the moment as I'm not looking for it to be written for me (obviously) jus want to know if i can skip the empty files in some way without using linq as I'm using framework 1.0
thanks