我正在尝试登录HTTPS网站然后导航以使用c#(它的xml报告)下载报告?
我已经设法通过cookie /标题等登录OK - 但每当我登录后导航到链接,我的连接将我带到"已注销"页面?
谁知道会导致什么?
确保您用于登录的CookieContainer与下载实际报告时使用的CookieContainer相同.
var cookies = new CookieContainer();
var wr1 = (HttpWebRequest) HttpWebRequest.Create(url1);
wr1.CookieContainer = cookies;
// do login here with wr1
var wr2 = (HttpWebRequest) HttpWebRequest.Create(url2);
wr2.CookieContainer = cookies;
// get the report with wr2
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
795 次 |
| 最近记录: |