/// <summary> /// 启动压力测试 /// </summary> public void DoStart() { StartEnable = false; LogHelper.Logger.Info("开始启动"); ExcelHelper excel = new ExcelHelper(@"defaultvalue.xlsx"); defaultTable = excel.ExcelToDataTable("Sheet1", true); IsWork = false; ReplyRateInfos.Clear(); caseList.Clear(); IsWork = true; foreach (var item in CaseGroups) { if (item.Check == 1) { Task task = Task.Factory.StartNew(() => { Work(item); }); } } }
private void GetAndOpenCase() { try { if (_LoadCase != null) { System.Windows.Forms.OpenFileDialog ofd = new System.Windows.Forms.OpenFileDialog(); ofd.Filter = "(*.xml)|*.xml"; ofd.InitialDirectory = Environment.CurrentDirectory; ofd.Multiselect = false; if (ofd.ShowDialog() == DialogResult.OK) { caseFilePath = ofd.FileName; ReplyRateInfos.Clear(); } } DoCaseLoad(); } catch (Exception error) { this.Dispatcher.Invoke(() => { MessageBox.Show($"{error.Message} \r\n {error.StackTrace}"); }); } }