C#登陆QQ的网站

hkjat1 2010-09-20 10:13:16
下面这代码应该是登陆QQ空间的,但是如果没开通QQ空间的话,isLogin就是false了
所以我想登陆my.qq.com判断账号密码是否正确
但是.. HttpHelper.GetHtml("http://php.qzone.qq.com/index.php?mod=portal&act=login", cookie);
这里的地址是什么呢= =

            string username = txtQQ.Text;
string userPWD = txtPW.Text;
string verifyCode = txtVerify.Text;
string errorTxt = string.Empty;
string strRetVal = Utils.getMd5Hash2(Utils.getMd5Hash(userPWD).ToUpper() + verifyCode.ToUpper()).ToUpper();
string postData = "u=" + username + "&p=" + strRetVal + "&verifycode=" + verifyCode + "&aid=15000101&u1=http%3A%2F%2Fphp.qzone.qq.com%2Findex.php%3Fmod%3Dportal%26act%3Dlogin&fp=loginerroralert&h=1&ptredirect=1&ptlang=0&from_ui=1&dumy=";
string result = HttpHelper.GetHtml("http://ptlogin2.qq.com/login", postData, true, cookie);
errorTxt = result;
result = HttpHelper.GetHtml("http://php.qzone.qq.com/index.php?mod=portal&act=login", cookie);
bool isLogin = result.Contains("g_iLoginUin = " + username);
if (!isLogin)
{
if (result.Contains("完成跳转"))
{
isLogin = true;
}
else
{
if (!isLogin)
{
if (result.Contains("g_iLoginUin=" + username))
{
isLogin = true;
}
else
{
errorTxt = Utils.NoHTML(errorTxt);
isLogin = false;
}
}
}
}
else
{
isLogin = true;
}
...全文
417 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
wang_cyi 2011-04-12
  • 打赏
  • 举报
回复
string strRetVal = Utils.getMd5Hash2(Utils.getMd5Hash(userPWD).ToUpper() + verifyCode.ToUpper()).ToUpper();
这个问题你明白了

<html>
<head><meta http-equiv=\"Content-Language\" content=\"zh-cn\"><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
<title>登录失败</title> </head><script language=\"Javascript\">alert(\"您输入的验证码有误,请重试。\");history.go(-1);</script></html>
fangxiaofelix 2010-09-29
  • 打赏
  • 举报
回复
路过学习了!!
yvhkaii 2010-09-29
  • 打赏
  • 举报
回复
这是登陆好后的跳转地址
hkjat1 2010-09-21
  • 打赏
  • 举报
回复
继续顶...
parverxiao 2010-09-21
  • 打赏
  • 举报
回复
这个没弄过。。。。
hkjat1 2010-09-21
  • 打赏
  • 举报
回复
没人知道吗

110,548

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧