修复HttpHelper...

master
j502647092 2015-07-30 20:46:51 +08:00
parent 5858a6323b
commit 2bc2488a9f
2 changed files with 10 additions and 10 deletions

View File

@ -106,15 +106,15 @@ namespace SEOKeywordSearch
this.ResultView.Rows[index].Cells[s.ToString() + "r"].Value = "查询第" + i + "页..."; this.ResultView.Rows[index].Cells[s.ToString() + "r"].Value = "查询第" + i + "页...";
Application.DoEvents(); Application.DoEvents();
httpHelper.Send(HttpMethod.GET, url); httpHelper.Send(HttpMethod.GET, url);
while (HttpHelper.readyState != HttpReadyState.) while (httpHelper.readyState != HttpReadyState.)
{ {
Application.DoEvents(); Application.DoEvents();
} }
string htmldoc = HttpHelper.responseBody; string htmldoc = httpHelper.responseBody;
if (string.IsNullOrEmpty(htmldoc)) if (string.IsNullOrEmpty(htmldoc))
{ {
state.ForeColor = Color.Red; state.ForeColor = Color.Red;
state.Text = "关键词 " + key + " 在 " + s.ToString() + " 第 " + i + " 页 网页抓取失败 错误:" + HttpHelper.ErrMsg; state.Text = "关键词 " + key + " 在 " + s.ToString() + " 第 " + i + " 页 网页抓取失败 错误:" + httpHelper.ErrMsg;
this.ResultView.Rows[index].Cells[s.ToString() + "r"].Style.ForeColor = Color.Red; this.ResultView.Rows[index].Cells[s.ToString() + "r"].Style.ForeColor = Color.Red;
maybe = true; maybe = true;
continue; continue;

View File

@ -42,13 +42,13 @@ namespace CityCraft
} }
public class HttpHelper public class HttpHelper
{ {
public static HttpReadyState readyState = HttpReadyState.; public HttpReadyState readyState = HttpReadyState.;
public static int Status = 0; public int Status = 0;
public static string responseBody = ""; public string responseBody = "";
public static string responseText = ""; public string responseText = "";
public static byte[] responseByte = null; public byte[] responseByte = null;
public static HttpArgs args = new HttpArgs(); public HttpArgs args = new HttpArgs();
public static string ErrMsg = string.Empty; public string ErrMsg = string.Empty;
/// <summary> /// <summary>
/// 提交方法 /// 提交方法
/// </summary> /// </summary>