|
发表于 2014-5-14 10:08:01
|
显示全部楼层
谢谢苏飞这么快的回应!
但是,在穿件证书的保存,“未找到指定文件”,请问苏飞,还需要自己写个证书文件吗?这可怎么写呀?
谢谢谢谢谢。。。。
《下面是代码。。。》
// 这一句一定要写在创建连接的前面。使用回调的方法进行证书验证。
ServicePointManager.ServerCertificateValidationCallback = new System.Net.Security.RemoteCertificateValidationCallback(CheckValidationResult);
Encoding encoding = Encoding.Default;
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://account.xiaomi.com/pass/serviceLoginAuth2");
//创建证书文件
X509Certificate objx509 = new X509Certificate(Application.StartupPath + "\\123.cer","123");
//
HttpHelper http = new HttpHelper();
HttpItem item = new HttpItem()
{
...........//略
};
//证书加载
item.ClentCertificates.Add(objx509);
HttpResult result = http.GetHtml(item);
string html = result.Html;
string cookie = result.Cookie; |
|