private void SettingDetectionList(UrlScan urlScan) { Task <List <Detection> > .Factory.StartNew(() => { ShowProcess(true); List <Detection> detections = new List <Detection>(); PropertyInfo[] propertyInfos = urlScan.scans.GetType().GetProperties(); foreach (PropertyInfo propertyInfo in propertyInfos) { if (propertyInfo.GetValue(urlScan.scans, null) is IUrlScanInfo fileScanInfo) { string engine = propertyInfo.Name; bool detected = fileScanInfo.detected; string result = fileScanInfo.result?.ToString(); detections.Add(Detection.CreateDetection(engine, detected, string.Empty, result, string.Empty)); } } return(detections); }).ContinueWith(e => { DetectionListView.SetObjects(e.Result); ShowProcess(false); }); }
private void InitializeUrlScanContol(UrlScan urlScan) { lb_info1.Text = string.Empty; lb_info1Result.Text = string.Empty; lb_info2.Text = nameof(urlScan.url).ToUpper(); lb_info2Result.Text = urlScan.url ?? string.Empty; lb_info3.Text = string.Empty; lb_info3Result.Text = string.Empty; llb_permalinkResult.Text = urlScan.permalink ?? string.Empty; }
private void btn_start_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txt_Urls.Text)) { return; } Program.logger.Info("URL 스캔 시작"); Task.Factory.StartNew(() => { try { ChangeEnabled(btn_start, false); ChangeEnabled(btn_detail, false); UrlScan = ApiController.UrlReport(txt_Urls.Text); if (UrlScan is null) { Program.logger.Error($"{txt_Urls.Text} URL 스캔 에러"); return; } Program.logger.Info($"{txt_Urls.Text} URL 스캔 시작"); ChangeText(lb_msg, UrlScan.verbose_msg); ChangeText(lb_scanDate, UrlScan.scan_date); if (UrlScan.response_code == 1) { ChangeEnabled(btn_detail, true); } Program.logger.Info($"{txt_Urls.Text} URL 스캔 완료"); } finally { ChangeEnabled(btn_start, true); } }); }