使用httpwebrequest向服务器发包,一直是服务器繁忙怎么办。 纠结了一下午了蛋都碎了。。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 string loginRespHtml = null; Dictionary<string, string> postDict = new Dictionary<string, string>(); postDict.Add("__VIEWSTATE", "dDwtMTUxNzM0MjM0Mjs7Pot0nxzpyf7s6ZEFm%2F41QONw9iU9"); //postDict.Add("codestring", ""); postDict.Add("TextBox1",textBox1.Text); postDict.Add("TextBox2", textBox2.Text); postDict.Add("RadioButtonList1", "%D1%A7%C9%FA"); postDict.Add("Button1", ""); postDict.Add("lbLanguage", ""); string baiduMainUrl = "http://61.139.105.138/xs_main.aspx"; loginRespHtml = getUrlRespHtml(baiduMainUrl, postDict); MessageBox.Show(loginRespHtml); webBrowser1.Navigate("about:blank"); while (webBrowser1.ReadyState != WebBrowserReadyState.Complete) { Application.DoEvents(); } webBrowser1.Document.Write(ConvertExtendedASCII(loginRespHtml));这是按按钮登录的代码。 private string getUrlRespHtml(string url, Dictionary<string, string> postDict) { string respHtml = ""; //HttpWebResponse resp = getUrlResponse(url, headerDict, postDict, timeout); HttpWebResponse resp = getUrlResponse(url, postDict, ""); //long realRespLen = resp.ContentLength; StreamReader sr; sr = new StreamReader(resp.GetResponseStream(), System.Text.Encoding.GetEncoding("GB2312")); respHtml = sr.ReadToEnd(); return respHtml; } private string getUrlRespHtml(string url, Dictionary<string, string> postDict) { string respHtml = ""; //HttpWebResponse resp = getUrlResponse(url, headerDict, postDict, timeout); HttpWebResponse resp = getUrlResponse(url, postDict, ""); //long realRespLen = resp.ContentLength; StreamReader sr; sr = new StreamReader(resp.GetResponseStream(), System.Text.Encoding.GetEncoding("GB2312")); respHtml = sr.ReadToEnd(); return respHtml; } JS不能隐藏DIV??求救 asp.net 试卷自动生成系统 在搜索结果中,如何按字母顺序显示当前字母下面的数据列表。 请问一下微软的企业资源库怎样下载?谢谢! 求助求助求助 EXCEL中关于sheet复制的怪问题,大家来看看 关于TreeView控件的图片大小能否自定义? datagrid中项链接的问题 [在线等待]水晶报表"无效密钥号码"怎么解决?? help me to debug 做练习的时候遇到了一个窗体神级器的问题。。。 asp.net mvc中该怎样使用jquery的post方法
Dictionary<string, string> postDict = new Dictionary<string, string>();
postDict.Add("__VIEWSTATE", "dDwtMTUxNzM0MjM0Mjs7Pot0nxzpyf7s6ZEFm%2F41QONw9iU9");
//postDict.Add("codestring", "");
postDict.Add("TextBox1",textBox1.Text);
postDict.Add("TextBox2", textBox2.Text);
postDict.Add("RadioButtonList1", "%D1%A7%C9%FA");
postDict.Add("Button1", "");
postDict.Add("lbLanguage", "");
string baiduMainUrl = "http://61.139.105.138/xs_main.aspx";
loginRespHtml = getUrlRespHtml(baiduMainUrl, postDict);
MessageBox.Show(loginRespHtml);
webBrowser1.Navigate("about:blank");
while (webBrowser1.ReadyState != WebBrowserReadyState.Complete)
{
Application.DoEvents();
}
webBrowser1.Document.Write(ConvertExtendedASCII(loginRespHtml));这是按按钮登录的代码。
private string getUrlRespHtml(string url, Dictionary<string, string> postDict)
{
string respHtml = ""; //HttpWebResponse resp = getUrlResponse(url, headerDict, postDict, timeout);
HttpWebResponse resp = getUrlResponse(url, postDict, ""); //long realRespLen = resp.ContentLength; StreamReader sr; sr = new StreamReader(resp.GetResponseStream(), System.Text.Encoding.GetEncoding("GB2312")); respHtml = sr.ReadToEnd(); return respHtml; }
private string getUrlRespHtml(string url, Dictionary<string, string> postDict)
{
string respHtml = ""; //HttpWebResponse resp = getUrlResponse(url, headerDict, postDict, timeout);
HttpWebResponse resp = getUrlResponse(url, postDict, ""); //long realRespLen = resp.ContentLength; StreamReader sr; sr = new StreamReader(resp.GetResponseStream(), System.Text.Encoding.GetEncoding("GB2312")); respHtml = sr.ReadToEnd(); return respHtml; }