|
1金钱
post提交后返回的是( 本次请求并未返回任何数据)
private string post(string url, string data, string cookie, ref string cookies, string referer)
{
HttpHelper http = new HttpHelper();
HttpItem item = new HttpItem()
{
URL = url,//URL 必需项
Method = "POST",//URL 可选项 默认为Get
Timeout = 100000,//连接超时时间 可选项默认为100000
ReadWriteTimeout = 30000,//写入Post数据超时时间 可选项默认为30000
IsToLower = false,//得到的HTML代码是否转成小写 可选项默认转小写
Cookie = cookie,//字符串Cookie 可选项
UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Firefox/31.0",//用户的浏览器类型,版本,操作系统 可选项有默认值
Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",// 可选项有默认值
ContentType = "application/x-www-form-urlencoded",//返回类型 可选项有默认值
Referer = referer,//来源URL 可选项
//Allowautoredirect = true,//是否根据301跳转 可选项
//CerPath = "d:\123.cer",//证书绝对路径 可选项不需要证书时可以不写这个参数
//Connectionlimit = 1024,//最大连接数 可选项 默认为1024
Postdata = data,//Post数据 可选项GET时不需要写
//ProxyIp = "192.168.1.105",//代理服务器ID 可选项 不需要代理 时可以不设置这三个参数
//ProxyPwd = "123456",//代理服务器密码 可选项
//ProxyUserName = "administrator",//代理服务器账户名 可选项
//ResultType = ResultType.String,//返回数据类型,是Byte还是String
};
HttpResult result = http.GetHtml(item);
string html = result.Html;
cookies = result.Cookie;
return html;
}
private void button1_Click(object sender, EventArgs e)
{
string cookie = "";
string cookies = "";
string return_bin = Get("http://w326004.s135-101.myverydz.com/admin.php",cookie ,ref cookies).ToString();
string user_sid = betton(return_bin, "value=\"", "\">");
string url = "http://w326004.s135-101.myverydz.com/admin.php?";
string data = "sid="+user_sid+"&frames=yes&admin_username="+textBox1.Text.Trim()+"&admin_password="+textBox2.Text.Trim()+"&admin_questionid=0&admin_answer=&submit=%CC%E1%BD%BB";
string POST_bin = post(url, data, cookies, ref cookie, "http://w326004.s135-101.myverydz.com/admin.php");
textBox3.AppendText(POST_bin);
}
}
}
附上源码麻烦帮我看看谢谢了
|
|