请高手 cuike519 过来接分(500)2 请高手 cuike519 过来接分(500),由于一次只能给100,所以连开5贴,还有一个问题想请教您,就是 楼主你是不是重定向将那个 request.AllowAutoRedirect = false; 然后再单独去get从定向后的网页获取第二个sessionid?有办法在设为true的情况下获取第二个sessionid没有? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 public static string GetPage(string url, string postData,string encodeType,out string err) { Stream outstream = null; Stream instream = null; StreamReader sr = null; HttpWebResponse response = null; HttpWebRequest request = null; Encoding encoding = Encoding.GetEncoding(encodeType); byte[] data = encoding.GetBytes(postData); // 准备请求... try { // 设置参数 request = WebRequest.Create(url) as HttpWebRequest; CookieContainer cookieContainer = new CookieContainer(); request.CookieContainer = cookieContainer; request.AllowAutoRedirect = true; request.Method = "POST"; request.ContentType = "application/x-www-form-urlencoded"; request.ContentLength = data.Length; outstream = request.GetRequestStream(); outstream.Write(data,0,data.Length); outstream.Close(); //发送请求并获取相应回应数据 response = request.GetResponse() as HttpWebResponse; //直到request.GetResponse()程序才开始向目标网页发送Post请求 instream = response.GetResponseStream(); sr = new StreamReader( instream, encoding ); //返回结果网页(html)代码 string content = sr.ReadToEnd(); err = string.Empty; return content; } catch(Exception ex) { err = ex.Message; return string.Empty; } } 你参考一下 哦 Happy New Year 接了,为了这个问题我也自己搭了环境也测试了,呵呵,算是回报吧。本来想借助楼主的帖子在2009年冲4星。2010也不算晚,哈哈,谢了。虽然没有完全给出楼主最终发帖的实现代码,但是细节我已经描述的比较清楚,有兴趣的可以试一试,不要看到https就觉得没办法了,https是一个登录服务器,登录服务器验证、发票,另一个服务器http的验票,过程就是这样,所以没什么特殊的。希望楼主早日解决问题,恕我不能给你源码。 为什么我往ComBox上添加不上数据?C# ProductExportTemplate.aspx 模板导出 Excel 问题 求解C# Socket 互通信的问题 如何用一个方法把每个textbox添加change事件 c# c/s结构系统 startIndex 不能大于字符串长度。怎么解决。。。。。。。。 实现类似word的插入对象-难题求解! ▲▲▲▲▲第三次开贴求解决方法 在WEB Form中怎样做菜单?谢谢! 请问C#有访问串口,USB等硬件设备的类吗? 在EXCEL模版中插入新行 急!!! 高手们帮帮忙!!! 谢谢!!! 请高手 cuike519 过来接分(500)1 求教:关于鼠标指针的图标
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货