通过Htt的prequest的Windows Live ID登录 [英] Windows Live ID login via HttpRequest

查看:268
本文介绍了通过Htt的prequest的Windows Live ID登录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过Htt的prequest / Htt的presponse一台Web交互。但是,网络需要通过Windows Live ID登录。我去现场登录页面,但我无法从登录页面的任何可用的响应。

I want interact with one web via HttpRequest/HttpResponse. But the web requires login via Windows Live ID. I go to the live login page, but I can't get any usable response from login page.

用于访问登录页面的code:

The code used to access the login page:

var request = (HttpWebRequest)WebRequest.Create("http://login.live.com/");
request.Timeout = 30000; 
request.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.8) Gecko/20100202 Firefox/3.5.8 (.NET CLR 3.5.30729)"; 
request.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"; 
request.Headers.Add("Accept-Language", "en-us,en;q=0.5"); 
request.Headers.Add("Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7"); 
request.Headers.Add("Keep-Alive", "300"); 
request.ContentType = "application/x-www-form-urlencoded"; 
request.CookieContainer = new CookieContainer(); 
request.Method = WebRequestMethods.Http.Get; 

var response = (HttpWebResponse)request.GetResponse();

和响应:

饼干必须获准

您的浏览器目前设置为阻止Cookie。   您的浏览器必须允许Cookie之前   您可以使用Windows Live ID。

Your browser is currently set to block cookies. Your browser must allow cookies before you can use Windows Live ID.

Cookies是小的文本文件存储在   您的计算机告诉的Windows Live   ID站点,当你服务   登录。要了解如何让   饼干,看到你的Web联机帮助   浏览器。

Cookies are small text files stored on your computer that tell Windows Live ID sites and services when you're signed in. To learn how to allow cookies, see online help in your web browser.

我有一个对另一个网页饼干没问题,我无法找到任何方式,如何克服这个消息。

I have no problem with cookies on another web pages and I can't found any way, how to get over this message.

你们任何人有一个想法,如何解决呢? 谢谢!

Do you anybody have an idea, how to solve it? Thanks!

推荐答案

我发现了如何访问Windows Live ID与C#和建立客户一个完整的教程。

I found a complete tutorial on how to access Windows Live ID with C# and building the client.

在这里阅读:的http://www.devarticles.com/c/a/C-Sharp/Hotmail-Exposed-Access-Hotmail-using-C-sharp/

这篇关于通过Htt的prequest的Windows Live ID登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆