Visual C#:连接到Google帐户
我正在尝试连接我的谷歌帐户,并获得我的博客主页的html代码。我发现需要一个cookies来保持连接,但我不知道怎么做 用户名和密码的邮寄地址为“https://www.google.com/accounts/ClientLogin" 提前谢谢 有一些关于如何做事的好例子。如何从博客中检索帖子。希望有帮助。试试这个Visual C#:连接到Google帐户,c#,connection,account,C#,Connection,Account,我正在尝试连接我的谷歌帐户,并获得我的博客主页的html代码。我发现需要一个cookies来保持连接,但我不知道怎么做 用户名和密码的邮寄地址为“https://www.google.com/accounts/ClientLogin" 提前谢谢 有一些关于如何做事的好例子。如何从博客中检索帖子。希望有帮助。试试这个 private bool Authorize(out string authCode) { bool result = false; authCode = "";
private bool Authorize(out string authCode)
{
bool result = false;
authCode = "";
string queryString = String.Format("https://www.google.com/accounts/ClientLogin?accountType=HOSTED_OR_GOOGLE&Email={0}&Passwd={1}&service=cloudprint&source={2}", UserName, Password, Source);
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(queryString);
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
string responseContent = new StreamReader(response.GetResponseStream()).ReadToEnd();
string[] split = responseContent.Split('\n');
foreach (string s in split)
{
string[] nvsplit = s.Split('=');
if (nvsplit.Length == 2)
{
if (nvsplit[0] == "Auth")
{
authCode = nvsplit[1];
result = true;
}
}
}
return result;
}
`emmm结果是SID LSID和AUTH,但我如何才能得到“html代码”?