HttpWebRequest myReq = (HttpWebRequest)HttpWebRequest.Create("http://vip.qidian.com/BookReader/ChapterImage.aspx?bookId="+bookid+"&chapterId="+zjid+"&page=0");
//HttpWebRequest myReq = (HttpWebRequest)HttpWebRequest.Create("http://a.65276588.cn/top.aspx");
//HttpWebRequest myReq = (HttpWebRequest)HttpWebRequest.Create("http://my.qidian.com/User/Index.aspx");
myReq.Timeout = 8000;
myReq.ContentType = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*";
//myReq.ContentType = "text/html";
//myReq.Connection = "Keep-Alive";
myReq.Headers.Add("Accept-Language", "zh-cn");
myReq.Headers.Add("Accept-Encoding", "gzip, deflate");
myReq.Accept = "*/*";
//myReq.Headers.Add("Host", "my.qidian.com");
//myReq.Headers.Add("Connection", "Keep-Alive");
myReq.CookieContainer = getcookie();
myReq.Referer = "http://www.qidian.com";
myReq.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)";
HttpWebResponse HttpWResp;
try
{
HttpWResp = (HttpWebResponse)myReq.GetResponse();
}
catch (WebException ex)
{
return false;
} Stream str = HttpWResp.GetResponseStream(); System.Drawing.Image img = System.Drawing.Image.FromStream(str);// 这行报错 说传入的有错
//HttpWebRequest myReq = (HttpWebRequest)HttpWebRequest.Create("http://a.65276588.cn/top.aspx");
//HttpWebRequest myReq = (HttpWebRequest)HttpWebRequest.Create("http://my.qidian.com/User/Index.aspx");
myReq.Timeout = 8000;
myReq.ContentType = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*";
//myReq.ContentType = "text/html";
//myReq.Connection = "Keep-Alive";
myReq.Headers.Add("Accept-Language", "zh-cn");
myReq.Headers.Add("Accept-Encoding", "gzip, deflate");
myReq.Accept = "*/*";
//myReq.Headers.Add("Host", "my.qidian.com");
//myReq.Headers.Add("Connection", "Keep-Alive");
myReq.CookieContainer = getcookie();
myReq.Referer = "http://www.qidian.com";
myReq.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)";
HttpWebResponse HttpWResp;
try
{
HttpWResp = (HttpWebResponse)myReq.GetResponse();
}
catch (WebException ex)
{
return false;
} Stream str = HttpWResp.GetResponseStream(); System.Drawing.Image img = System.Drawing.Image.FromStream(str);// 这行报错 说传入的有错
解决方案 »
- 时间转换
- Page.ClientScript.RegisterClientScriptBlock
- 求助 怎样导出一个utf8 编码的 CSV 文件 最好.net
- asp.net 的html页面中取webconfig的值
- asp(c#)datagrid <ItemTemplate></ItemTemplate>中dropdownlist的怎么在后台显示出来~
- 奇怪的问题!变态的微软。
- 谁能提供给图片添加阴影的代码或者是例子?
- 地址栏中出现的未知字符串:如幽灵般挥之不去,请教各位高招!
- 看过Duwamish7.0 vb的请帮帮忙!!!
- 紧急求助!在asp.net页面上显示图片的缩略图
- 菜鸟问题,求教!
- asp.net工作流 实现可拖动控制流程
将body部分用gzip解压缩
HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.Create("");
myHttpWebRequest.AllowAutoRedirect = true;
myHttpWebRequest.KeepAlive = true;
myHttpWebRequest.Accept = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/msword, application/x-shockwave-flash, */*";
myHttpWebRequest.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Maxthon; .NET CLR 2.0.50727)";
myHttpWebRequest.ContentType = "application/x-www-form-urlencoded";
myHttpWebRequest.Method = "POST";Visual Sniffer 捕捉提交信息