public void MainLoop() { while (true) { var list = DataBookHelper.GetCheckList(); string error; foreach (var item in list) { error = string.Empty; var record = new Record() { DID = item.ID }; if (DataBookHelper.Examine(item, out error)) { record.Flag = true; } else { record.Flag = false; } record.Mark = error; try { DataBookHelper.Records(record); } catch (Exception ex) { Console.WriteLine(ex.Message); } } Thread.Sleep(500); } }
public static void Process() { var list = DataBookHelper.GetCheckList(); string error; foreach (var item in list) { error = string.Empty; var record = new Record() { DID = item.ID }; if (DataBookHelper.Examine(item, out error)) { record.Flag = true; } else { record.Flag = false; } record.Mark = error; DataBookHelper.Records(record); } }