100分,请问怎样用wininet发包含图片附件的帖子到discuz论坛上?

cs_iceworld 2008-03-04 09:17:02
想发帖子(帖子中包含图片附件)到discuz论坛上,请问用WinInet怎么做?谢谢。下面是我抓的包:

POST /post.php?action=newthread&fid=25&extra=page%3D1&topicsubmit=yes HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/xaml+xml, application/vnd.ms-xpsdocument, application/x-ms-xbap, application/x-ms-application, */*
Referer: http://www.cash163.com/post.php?action=newthread&fid=25&extra=page%3D1
Accept-Language: zh-cn
Content-Type: multipart/form-data; boundary=---------------------------7d81093510146
UA-CPU: x86
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; QQDownload 1.7; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; Maxthon; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; Alexa Toolbar)
Host: www.xxx.com
Content-Length: 67981
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: OWg_sid=UXyDyE; OWg_cookietime=315360000; OWg_auth=wsrO5f5SztNcXE%2F5yTNJlMRB%2F0G9gaIXVAHuv3U6j7PuOS4JdF73RcHDybTr4b8; OWg_visitedfid=25; AJSTAT_ok_times=4; rtime=3; ltime=1204633624562; cnzz_eid=77054026-; AJSTAT_ok_pages=13; cnzz02=10; OWg_oldtopics=D335504D335578D335659D; OWg_fid25=1204633434; isjssuport=yes; OWg_onlineusernum=7315

-----------------------------7d81093510146
Content-Disposition: form-data; name="formhash"

f0f7bfb5
-----------------------------7d81093510146
Content-Disposition: form-data; name="isblog"


-----------------------------7d81093510146
Content-Disposition: form-data; name="frombbs"

1
-----------------------------7d81093510146
Content-Disposition: form-data; name="readperm"

0
-----------------------------7d81093510146
Content-Disposition: form-data; name="price"

0
-----------------------------7d81093510146
Content-Disposition: form-data; name="subject"

比调客网还好的新站!我加入8天已2次收款!
-----------------------------7d81093510146
Content-Disposition: form-data; name="iconid"

0
-----------------------------7d81093510146
Content-Disposition: form-data; name="message"

免费加入新豆网:你可以
1.通过新豆网去合作商家注册获得返现:37元!(2008年3月31日前满10元即可提现!)
2.购物返现:通过新豆网在当当、卓越等进行网上购物最高返利25%!
3.推荐朋友也赚钱:完全免费,推荐一人0.5元!如果你推荐的朋友生成购物返利或注册返利成功,你可以再获得3元!
4.每月新豆网都有精彩活动!例如:2月1日--2月29日的活动:从会员中抽取幸运奖:共111名!奖励5--100元!nano、psp有机会免费抱回家!还有其他更多礼物,还不心动吗!
5.新豆会员可以免费开设我的商店,好朋友、零花钱都会滚滚而来!
注册地址: [size=6]http://www.51xindou.com/[/size]
-----------------------------7d81093510146
Content-Disposition: form-data; name="attach[]"; filename=""
Content-Type: application/octet-stream


-----------------------------7d81093510146
Content-Disposition: form-data; name="localid[]"


-----------------------------7d81093510146
Content-Disposition: form-data; name="attachperm[]"

0
-----------------------------7d81093510146
Content-Disposition: form-data; name="attachprice[]"

0
-----------------------------7d81093510146
Content-Disposition: form-data; name="attachdesc[]"


-----------------------------7d81093510146
Content-Disposition: form-data; name="attach[]"; filename="C:\新豆.JPG"
Content-Type: image/pjpeg

? JFIF ` `  LEAD Technologies Inc. V1.01  ?
-----------------------------7d81093510146
Content-Disposition: form-data; name="localid[]"

1
-----------------------------7d81093510146
Content-Disposition: form-data; name="attachperm[]"

0
-----------------------------7d81093510146
Content-Disposition: form-data; name="attachprice[]"

0
-----------------------------7d81093510146
Content-Disposition: form-data; name="attachdesc[]"


-----------------------------7d81093510146
Content-Disposition: form-data; name="attach[]"; filename=""
Content-Type: application/octet-stream


-----------------------------7d81093510146
Content-Disposition: form-data; name="localid[]"

2
-----------------------------7d81093510146
Content-Disposition: form-data; name="attachperm[]"

0
-----------------------------7d81093510146
Content-Disposition: form-data; name="attachprice[]"

0
-----------------------------7d81093510146
Content-Disposition: form-data; name="attachdesc[]"


-----------------------------7d81093510146
Content-Disposition: form-data; name="wysiwyg"

1
-----------------------------7d81093510146--
...全文
103 点赞 收藏 6
写回复
6 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
eduyu 2008-03-05
1,找到能接受带图片post的网页
2,对它用IE来post
3,dump下IE的这个post,看看IE是怎么组织,注意我第三张图,是一个GIF文件。
回复
cs_iceworld 2008-03-05
我就是用httpwatch抓的呀,但是该怎么post图片附件呀?一般的文字信息我会post
回复
eduyu 2008-03-05
用HTTP Watch工具dump下IE发送的POST,稍微研究下就明白了。给你几张图。
[img=http://iamduyu.googlepages.com/Snippy0001.jpg]http://iamduyu.googlepages.com/Snippy0001.jpg[/img]
[img=http://iamduyu.googlepages.com/Snippy0002.jpg]http://iamduyu.googlepages.com/Snippy0002.jpg[/img]
[img=http://iamduyu.googlepages.com/Snippy0003.jpg]http://iamduyu.googlepages.com/Snippy0003.jpg[/img]
回复
cs_iceworld 2008-03-05
怎么没人哦,分不够可以再加呀!
回复
cs_iceworld 2008-03-04
谢谢ls,Referer和cookie都好办,这个都实现了,就是发送图片附件不知道怎么搞啊
回复
eduyu 2008-03-04
注意http消息的Referer字段,
现在服务器一般会判断这个字段,不符合就不让post。
当然cookie字段是最基本的。
建议用操控IE来post。
回复
相关推荐
发帖
网络编程
创建于2007-09-28

1.8w+

社区成员

VC/MFC 网络编程
申请成为版主
帖子事件
创建了帖子
2008-03-04 09:17
社区公告
暂无公告