public BindingList<CurrentCaptureFile> CheckForNewFiles(string inputFilePath, string outputFilePath) { BindingList<CurrentCaptureFile> currentCaptureFiles = new BindingList<CurrentCaptureFile>(); FileInfo[] fi = null; string currentCaptureFileName = string.Empty; // Process the file ProcessCapturePackets pcp = new ProcessCapturePackets(); try { if (inputFilePath != "") { DirectoryInfo di = new DirectoryInfo(inputFilePath); fi = di.GetFiles(); foreach (var file in fi) { if (file.Name != "TestFile.txt") { pcp.ProcessPacketFile(file.Name); if (currentCaptureFileName != file.Name) { CurrentCaptureFile ccf = new CurrentCaptureFile(); ccf = pcp.GetCurrentCaptureFile(file.Name); currentCaptureFiles.Add(ccf); } } // Move the file to the done folder File.Move(inputFilePath + "\\" + file.Name, outputFilePath + "\\" + file.Name); } } } catch (Exception ex) { // Possible conflict with parse files service - ignore this error for now - we'll try // again in a few seconds } return currentCaptureFiles; }