public static void ScanDir(string[] strings, string[] args) { if (args.Length == 0) { //args = new string[] { @"C:\EMLs" }; throw new Exception("first argumant should be directory to scan..."); } Console.WriteLine("Getting files..."); string[] fileEntries = Directory.GetFiles(args[0]); Console.WriteLine("Got " + fileEntries.Length.ToString("#,##0") + " files..."); int left = 0; int exceptions = 0; int i = 0; int ignored = 0; int ignoredHard = 0; int hardBounces = 0; Bounce b = new Bounce(); b.UnlockComponent("DONTSTAYINBOUNCE_OS2MBg0e7GpB"); foreach (string fileName in fileEntries) { try { b.ExamineEml(fileName); dealWithBounce(strings, b, fileName, ref hardBounces, ref ignoredHard, ref ignored); } catch (Exception ex) { exceptions++; } i++; if (i % 100 == 0) Console.WriteLine("Processed: " + i.ToString("#,##0") + " / " + fileEntries.Length.ToString("#,##0") + ", hardBounces: " + hardBounces.ToString("#,##0") + ", ignoredHard: " + ignoredHard.ToString("#,##0") + ", ignored: " + ignored.ToString("#,##0") + ", errors: " + exceptions.ToString("#,##0")); } }