public RiskAnalyzer(Settings settings) { if (settings == null) { throw new ArgumentNullException("RiskAnalyzer constructor params can't be null"); } http if (string.IsNullOrEmpty(settings.GitHubOrganization) || string.IsNullOrEmpty(settings.GitHubRepository) || string.IsNullOrEmpty(settings.GitHubToken)) { throw new ArgumentException("GitHub settings are incomplete"); } http _settings = settings; MD5 _ruleset = Ruleset.FromDirectory("rules", null); _processor = new RuleProcessor(_ruleset) { EnableSuppressions = false, SeverityLevel = Severity.Critical | Severity.Important | Severity.Moderate | Severity.BestPractice | Severity.ManualReview }; this.ExecutionTimeOut = _settings.AnalyzerTimeout; }
async Task getResponseAsync(string artName) { client = new http(); string responseBody = await client.getAnsv(artName, apikey); GeoClass.Artists[] artistsFromResponce = GeoClass.Artists.FromJson(responseBody); List <GeoClass.Artists> artistsWithoutSTREAM = new List <GeoClass.Artists>(); foreach (GeoClass.Artists p in artistsFromResponce) { if (p.Venue.Latitude != null) { artistsWithoutSTREAM.Add(p); } } GeoClass.Artists[] artists = artistsWithoutSTREAM.ToArray <GeoClass.Artists>(); if ((responseBody != "\n\n[]\n") && (artists.Count() != 0)) { artists_list.Add(artists); listbox_artists.Items.Add(artists[0].Lineup[0]); metod(); } else { System.Windows.MessageBox.Show("Концерты " + artName + " не найдены"); }; }
public Task <string> GetData() { http test = new http(); return(test.HttpRequestAsync()); }
public void UpSFC(int num) { http _http = new http(); HttpVar.site = Lab_site.Text; //读excel site HttpVar.request_id = DateTime.Now.ToString("yyyyMMddHHmmssfff").ToString() + "000001"; //写死 HttpVar.ip = "10.175.42.242"; //能改 HttpVar.barcode = HttpVar.barcode; //机台读取 HttpVar.barcode_type = "SP"; //能改 HttpVar.process = Lab_process.Text; //读excel process HttpVar.station = Lab_station.Text; //读excel station HttpVar.measurement_type = type_ComboBox.Text; //读excel measurement_ type ,然后选择 HttpVar.measurement_item = strmeasurement_item; //读excel measurement_ item HttpVar.equipment_id = Lab_equipment_id.Text; //读excel equipment_id HttpVar.fixture = Lab_fixture.Text; //读excel fixture HttpVar.fixture_version = HttpVar.fixture.Substring(HttpVar.fixture.Length - 1, 1); //fixture的最后一位 //检具版本 HttpVar.s_time = (DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")).ToString(); //第一次冲击开始; HttpVar.e_time = (DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")).ToString(); //最后冲击一次结束; HttpVar.inspector = "1/1"; //能改 HttpVar.config = config_ComboBox.Text; //写到画面 for (int i = 0; i < num; i++) { HttpVar.measurement_position[i] = HttpVar.measurement_position[i]; //读excel 位置 HttpVar.result[i] = lab_result.Text; //机台判断,实际冲击次数与excel规格值(次數) HttpVar.start_time[i] = (DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")).ToString(); //开始时间; HttpVar.end_time[i] = (DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")).ToString(); //开始时间; HttpVar.failure_mode[i] = failure_mode_cb[i].Text.Substring(0, failure_mode_cb[i].Text.Length - 2); //读excel failure_mode,然后选择 HttpVar.failuremode_code[i] = failure_mode_cb[i].Text.Substring(failure_mode_cb[i].Text.Length - 1, 1); //failure_mode的最后一位 HttpVar.number[i] = VarClass.ImpactCurrentNum[i].ToString(); //实际冲击次数 HttpVar.weight[i] = weight_Excel[i]; //读excel 重量 HttpVar.height[i] = height_Excel[i]; //读excel 高度 } HttpVar.resv1 = ""; //填空 HttpVar.resv2 = ""; //填空 HttpVar.resv3 = ""; //填空 _http.DataReport_Run(num); if (HttpVar.DataReport_recivedata_rc == "000") { VarClass.ImpactCurrentNum[VarClass.TestNumber - 1] = 0; VarClass.TestNumber = 0; Lab_uploading.Text = "上传成功"; VarClass.Testing = false; lab_barcode.Text = ""; for (int i = 0; i < BT_Position.Length; i++) //清空按钮text属性 && 隐藏gB { BT_Position[i].Text = "开始测试"; BT_Position[i].BackColor = Color.Gainsboro; myGroupBox[i].Visible = false; failure_mode_cb[i].Items.Clear(); } } else { Lab_uploading.Text = "上传失败"; MessageBox.Show("自动上传失败"); } }
public void add(Song s) { //仅显示7个已经下载歌曲 if (i > 7) { i = 0; panel1.Controls.Clear(); } //px.Visible = true; panel1.AutoScroll = false; Label l = new Label(); l.Location = new Point(0, 0); l.Size = new System.Drawing.Size(width, heitht); l.Tag = s; l.TextAlign = ContentAlignment.MiddleLeft; l.ForeColor = Color.White; l.DoubleClick += new EventHandler(label_Clsick); l.Text = s.Filename; Panel p1 = new Panel(); p1.BackColor = Color.FromArgb(119, 203, 63); p1.Location = new Point(x, i * y); p1.Size = new System.Drawing.Size(0, heitht); p1.Controls.Add(l); panel1.Controls.Add(p1); Panel p2 = new Panel(); p2.BackColor = Color.White; p2.Location = new Point(x, i * y); p2.Size = new System.Drawing.Size(width, heitht); Label bfb = new Label(); bfb.Location = new Point(width + 1, i * y); bfb.Size = new System.Drawing.Size(68, heitht); bfb.TextAlign = ContentAlignment.MiddleLeft; bfb.ForeColor = Color.White; bfb.BackColor = Color.Transparent; bfb.Text = "100%"; panel1.Controls.Add(bfb); panel1.Controls.Add(p2); DownLoad d = new DownLoad(); d.d = this; d.blue = p1; d.gray = p2; // d.btn = this.button2; d.s = s; kugou k = new kugou(); http h = new http(); String url = k.getinfo(s.Hash); String JsonText = h.getJsonText(url); String src = h.getUrl(JsonText); panel1.AutoScroll = true; //d.px = px; d.lb = bfb; d.Down(src, Path + s.Filename + "." + s.Extname); i++; }
public static void httpthread() { go_http = new GameObject(); instance_http = go_http.AddComponent <http>(); UnityEngine.Object.DontDestroyOnLoad(go_http); }
Sender sndr = new Sender(http://localhost:8082/CommService); // Sender needs localUrl for start message Message msg = new Message();