private void Connect() { while (true) { try { if (File.Exists(Resources.ResultData)) { var results = JsonConvert.DeserializeObject <List <Result> >(File.ReadAllText(Resources.ResultData)); var updater = new ResultSender(); foreach (var result in results) { updater.Connect(JsonConvert.SerializeObject(result)); } File.Delete(Resources.ResultData); } } catch (Exception e) { MessageBox.Show(e.Message, "rewwer", MessageBoxButtons.OK); } Thread.Sleep(10000); } }
private void Connect() { while (true) { try { if (File.Exists(Resources.ResultData)) { var results = JsonConvert.DeserializeObject <List <Result> >(File.ReadAllText(Resources.ResultData)); var updater = new ResultSender(); foreach (var result in results) { updater.Connect(JsonConvert.SerializeObject(result)); } File.Delete(Resources.ResultData); } } catch (Exception) { //ignore } Thread.Sleep(1000); } }