|
发表于 2012-12-14 14:22:47
|
显示全部楼层
admin 发表于 2012-12-14 09:54
你确定把账户和密码保存到Cookie里了吗?
我不确定账户信息是不是存在里面了,还有就是A系统的登录页面有个iform框架,这个框架包含登录所需的表单,但这个框架地址与A系统首页地址是完全不一样的!例如A系统首页为:http://abc.123.com,但填写账户信息的iform框架地址是:http://nba.bbc.cn;我如果获取Cookie,URL该使用哪个地址?
HttpHelper objhttp = new HttpHelper();
//参数对象
HttpItem objHttpItem = new HttpItem()
{
URL = "http://nba.bbc.cn",
Encoding = "gb2312",
Method = "GET",
};
//取Html
string text = objhttp.GetHtml(objHttpItem);
//参数对象
objHttpItem = new HttpItem()
{
URL = "http://nba.bbc.cn",
Postdata = "username=xxxx&userpwd=123456",
Encoding = "gb2312",
Method = "POST",
Referer = "",
Cookie = objHttpItem.Cookie,
IsToLower = false//是否转成小写
};
//取Html
string html = objhttp.GetHtml(objHttpItem); |
|