做个客户端登录软件,做过的人进。

lzol 2005-09-14 04:07:42
登录Chinaren为例,语句是这么写的
CInternetSession mySession(NULL,0);
CHttpFile* myHttpFile=NULL;
CString myData;
CString myUrl;
CString m_SiteInfo;
myUrl = "http://passport.sohu.com/login.jsp?uid=" + m_strName + "&passwd=" + m_strPwd;
myHttpFile=(CHttpFile*)mySession.OpenURL(myUrl);
while(myHttpFile->ReadString(myData))
{
m_SiteInfo = myData;
}
返回:您无法直接访问此网页
是Chinaren封了这种访问方式还是我调用的不对,请高手指教!
...全文
253 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
DrSmart 2005-10-29
  • 打赏
  • 举报
回复
除了cookie 可能还有session,还要模拟post出的数据 就像MapleInHG说的一样
skykeen 2005-10-29
  • 打赏
  • 举报
回复
学习
xiaoguaiwei 2005-10-28
  • 打赏
  • 举报
回复
模拟POST发送信息才可以
xx_jj 2005-10-11
  • 打赏
  • 举报
回复
学习
xiaoguaiwei 2005-10-11
  • 打赏
  • 举报
回复
你是用GET方式在登录,一些网站不允许,你应做成模拟POST才行。
MapleInHG 2005-09-14
  • 打赏
  • 举报
回复
下面是登录时的全部信息,其中有些是必须的,有些不是必须的,我觉得比较重要的可能是Referer及Cookie字段,当然后面的post数据也是必须的

POST /login.jsp HTTP/1.1
Accept: application/x-shockwave-flash, */*
Referer: http://alumni.chinaren.com/
Accept-Language: zh-cn
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; MyIE2)
Host: passport.sohu.com
Content-Length: 260
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: SUV=05051******29583; IPLOC=CN****; SOHUPP=****@chinaren.com

loginid=****@chinaren.com&ru=http%3A%2F%2Fprofile.chinaren.com%2Furs%2Fsetcookie.jsp%3Fburl%3Dhttp%3A%2F%2Falumni.chinaren.com%2Findex.jsp&appid=****&fl=1&vr=1%7C1&ct=*********&sg=c18f35c1af12dc1acb9&uid=****&utype=0&passwd=******&x=48&y=15
lzol 2005-09-14
  • 打赏
  • 举报
回复
能不能说的详细点?
MapleInHG 2005-09-14
  • 打赏
  • 举报
回复
除了URL外,还需要很多其它信息,比如Referer、Cookie等。

18,356

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 网络编程
c++c语言开发语言 技术论坛(原bbs)
社区管理员
  • 网络编程
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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