|
1金钱
本帖最后由 afgdxgood 于 2015-4-20 10:16 编辑
写了个程序,登陆之后,多线程的去访问同一个页面,如果内容包含自己想要的数据,就保存起来,可是 总是有404 的问题,是不是我代码有问题啊
public void fun()
{
while (true)
{
HttpItem item = new HttpItem()
{
URL = "https://gengo.com/t/jobs/",
Cookie = cookie
};
HttpResult result = http.GetHtml(item);
lock (DataClass.dt)
{
dr[2] = result.Html;
dr["上次访问时间"] = DateTime.Now.ToString();
if (dr[3].ToString() == "无")
{
if (result.Html.Contains("Details<"))
{
if (result.Html.Contains("0.08"))
{
dr[3] = " \r\n有一条新的pro任务";
}
else
{
dr[3] = " \r\n有一条新的str任务";
}
}
}
}
Thread.Sleep(1000);
}
}
|
|