|
本帖最后由 小米 于 2013-10-17 22:24 编辑
网站地址:https://sunlogin.oray.com/passport/login?lang=zh_CN
测试帐号:renrenle2013
测试密码:renrenle
这几天一直在尝试,都失败了。。。希望登录后跳转到https://sunlogin.oray.com/console/remote/获取数据列表。
主要遇到以下几个问题:
1、post数据仅设置account=renrenle2013时,源码里可看见表单有赋值,如果post数据多余一个例如account=renrenle2013&password=renrenle时,远从返回的html代码看见account和password的值都为空?
2、提交后返回Timeout...
3、问题loginItem.SecurityProtocolType = System.Net.SecurityProtocolType.Ssl3,HttpHelper里没有?
源码:
[code=csharp]
public partial class FrmMain : Form
{
public FrmMain()
{
InitializeComponent();
}
HttpItem loginItem = new HttpItem();
string url = "https://sunlogin.oray.com/passport/login?lang=zh_CN";
string pos = "account=renrenle2013&password=renrenle&url=/console/remote/";
//string pos = "url=/console/remote/&account=" + txtUser.Text.ToString() + "&password=" + txtPass.Text.ToString();
private void btnLogin_Click(object sender, EventArgs e)
{
loginItem.UserAgent = "Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A341 Safari/528.16";
loginItem.Method = "post";
loginItem.URL = url;
loginItem.Postdata = pos;
loginItem.ContentType = "application/x-www-form-urlencoded";
loginItem.Allowautoredirect = true;
loginItem.SecurityProtocolType = System.Net.SecurityProtocolType.Ssl3;//SecurityProtocolType.Ssl3;
HttpHelper httphelper = new HttpHelper();
HttpResult result = httphelper.GetHtml(loginItem);
txtLog.Text = result.Html;
}
}
[/code]
(1)响应头信息原始头信息
Cache-Control | no-store, no-cache, must-revalidate, post-check=0, pre-check=0 | Connection | keep-alive | Content-Type | text/html | Date | Thu, 17 Oct 2013 14:10:29 GMT | Expires | Thu, 19 Nov 1981 08:52:00 GMT | Front-End-Https | on | Pragma | no-cache | Server | nginx | Transfer-Encoding | chunked | (2)请求头信息原始头信息
Accept | text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 | Accept-Encoding | gzip, deflate | Accept-Language | zh-cn,zh;q=0.8,en-us;q=0.5,en;q=0.3 | Connection | keep-alive | Cookie | _tk_=benlak; locale=zh_CN; __utma=243673051.701896592.1381930490.1381984931.1382017270.5; __utmz=243673051.1381930490.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); _s_id_=n0f3hqnpj6dvpa2gn8vv69k4i1; __utmb=243673051.5.10.1382017270; __utmc=243673051 | Host | sunlogin.oray.com | Referer | https://sunlogin.oray.com/passport/login?lang=zh_CN | User-Agent | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Firefox/24.0 |
|
|