- 积分
- 40165
- 好友
- 记录
- 主题
- 帖子
- 听众
- 收听
|
发表于 2013-3-21 12:59:17
|
显示全部楼层
SillyPGM 发表于 2013-3-21 12:51
我纳闷在于,抓包显示的post模式,url和postdata也是分开的。为什么要写一起。这是必须的吗?
你想使用Post也行,只需要简单修改两个参数就行了, 看我下面的代码- HttpHelper http = new HttpHelper();
- HttpItem item = new HttpItem()
- {
- URL = "http://bbs.125.la/member.php?mod=logging&action=login&loginsubmit=yes&infloat=yes&lssubmit=yes&inajax=1",
- Method = "post",
- Postdata = "username=%C7%E1%C6%AE%C6%AE%B5%C4%D4%C6&password=dc483e80a7a0bd9ef71d8cf973673924&quickforward=yes&handlekey=ls",
- ResultType = ResultType.String
- , PostDataType=PostDataType.String,
- Referer="http://bbs.125.la/member.php",
- ContentType = "application/x-www-form-urlencoded"
- };
- HttpResult result = http.GetHtml(item);
- string html = result.Html;
复制代码 |
|