|
楼主 |
发表于 2014-1-24 19:25:58
|
显示全部楼层
我是这样做的,代码如下,得到的结果是手机验证码,但是通过IE访问这个页面需要普通验证
verifyCodeUrl = "";
bool result = false;
HttpItem item = new HttpItem();
item.URL = "https://mail.sina.com.cn";//"https://mail.sina.com.cn/register/regmail.php";
item.Allowautoredirect = false;
item.Timeout = 10000;
if (proxyIP != null)//使用代理
{
item.ProxyIp = proxyIP;
}//http://mail.sina.com.cn:443
//得到HTML代码
HttpResult httpResult = httpHelper.GetHtml(item);
item.Cookie = httpResult.Cookie;
// item.URL = "http://mail.sina.com.cn:443";
//httpResult = httpHelper.GetHtml(item);
item.URL = "https://mail.sina.com.cn/register/regmail.php";
httpResult = httpHelper.GetHtml(item);
if (httpResult.Html.Contains("欢迎注册新浪邮箱") != true)
{
if (proxyIP != null)//使用了代理
{
uiContext.Post(UpdateInfo, "代理IP失效!");
}
result = false;
}
else
{
verifyCodeUrl = GetVerifyCodeUrl(httpResult.Html);
} |
|