public static string RecvFileToQuery() { string firstLine; using (StreamReader reader = new StreamReader(BeforeDLIntervent.ACT_RECV_FILE, Encoding.ASCII)) { firstLine = reader.ReadLine(); } string[] firstLineTokens = firstLine.Split(' '); if (firstLineTokens.Length != 3) { throw new Exception("Bad HTTP request first line"); } string url = firstLineTokens[1]; StringTools.Island urlQuestion = StringTools.GetIsland(url, "?"); if (urlQuestion == null) { throw new Exception("クエリは指定されていません。"); } return(urlQuestion.Right); }
private void LoadReport() { this.MainSheet.Visible = false; try { int successCount = 0; int skippedCount = 0; int failedCount = 0; string[] lines = File.ReadAllLines(GetReportFile(), Encoding.UTF8); for (int rowidx = 0; rowidx * 2 < lines.Length; rowidx++) { string file = lines[rowidx * 2 + 0]; string cond = lines[rowidx * 2 + 1]; string elap; file = StringTools.GetIsland(file, "] ").Right; cond = StringTools.GetIsland(cond, "] ").Right; { StringTools.Island ilnd = StringTools.GetIsland(cond, " (処理時間:"); cond = ilnd.Left; elap = ilnd.Right; } elap = StringTools.GetIsland(elap, " ").Left; this.MainSheet.RowCount++; DataGridViewRow msRow = this.MainSheet.Rows[this.MainSheet.RowCount - 1]; msRow.Cells[0].Value = file; msRow.Cells[1].Value = cond; msRow.Cells[2].Value = elap; switch (this.MS_GetRowCondByCondString(cond)) { case MS_RowCond_e.Success: successCount++; break; case MS_RowCond_e.Skipped: skippedCount++; break; case MS_RowCond_e.Failed: failedCount++; break; default: throw null; } } this.ReportStatus.Text = string.Format("成功:{0} , スキップ:{1} , 失敗:{2}", successCount, skippedCount, failedCount); } finally { this.MainSheet.Visible = true; } }