- 论坛徽章:
- 0
|
我想c写一个程序和http服务器通信,脱离浏览器.服务器是要认证的,因此要处理cookies.但是我感觉cookies很麻烦,有些值仅从服务器传给我的信息中根本没有办法得到,不知道怎么弄了,还是他们是经过某种运算得到的.
[2009-3-11 4:29:41:876]
POST /interface/userlogin.aspx HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/msword, application/x-silverlight, */*
Referer: http://game.cs.js.cn/dgyz/enter/1/
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.1; SV1; CIBA)
Host: s1.diguo.popwan.com
Content-Length: 100
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: LNAME=uid635%404254; ADVALUE=84001A242807
userid=uid654@4254&name=popowan&Timestamp=1236716987&Sign=884ae0182370effedd62d7d329362a98&gameId=56
[2009-3-11 4:29:41:996]
HTTP/1.1 302 Found
Date: Tue, 10 Mar 2009 20:29:45 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Location: http://s1.diguo.popwan.com/empire/login.cfm?uname=%75%69%64%36%35%34%40%34%32%35%34&vcode=D9D4277240F89CAC944E4CA0380DBFAD&eflag=login&serverid=1
Cache-Control: private
Content-Type: text/html; charset=utf-8
Content-Length: 274
<html><head><title>Object moved</title></head><body>
<h2>Object moved to <a href="http://s1.diguo.popwan.com/empire/login.cfm?uname=%75%69%64%36%35%34%40%34%32%35%34&vcode=D9D4277240F89CAC944E4CA0380DBFAD&eflag=login&serverid=1">here</a>.</h2>
</body></html>
[2009-3-11 4:29:41:996]
GET /empire/login.cfm?uname=%75%69%64%36%35%34%40%34%32%35%34&vcode=D9D4277240F89CAC944E4CA0380DBFAD&eflag=login&serverid=1 HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/msword, application/x-silverlight, */*
Referer: http://game.cs.js.cn/dgyz/enter/1/
Accept-Language: zh-cn
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; CIBA)
Host: s1.diguo.popwan.com
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: LNAME=uid635%404254; ADVALUE=84001A242807
[2009-3-11 4:29:42:217]
HTTP/1.1 302 Moved Temporarily
Connection: close
Date: Tue, 10 Mar 2009 20:29:45 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
Set-Cookie: CFID=347899;expires=Thu, 03-Mar-2039 20:29:45 GMT;path=/
Set-Cookie: CFTOKEN=55299945;expires=Thu, 03-Mar-2039 20:29:45 GMT;path=/
Set-Cookie: LNAME=uid654%404254;expires=Sun, 28-Mar-2077 23:43:52 GMT;path=/
Set-Cookie: ADVALUE=84001A242807A242993;expires=Sun, 28-Mar-2077 23:43:52 GMT;path=/
location: index.cfm?page=proclaim
Content-Language: zh-CN
Content-Type: text/html; charset=UTF-8
比如红笔标出的,我就不知道如何从服务器的信息中得到.虽然我大致知道是什么意思.
希望大家帮我,弄了一个晚上 ,就卡在这里了
我是在vc6.0下写的
[ 本帖最后由 uid500 于 2009-3-11 07:09 编辑 ] |
|