当我把抓包工具打开时,就能正常获取其他网站图片,但是当我把抓包工具关闭时,HttpWebResponse httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse(); 就提示说"基础连接已关闭,基础连接已经关闭: 接收时发生错误。"
Uri url = new Uri(""); HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(url); httpWebRequest.KeepAlive = true; httpWebRequest.ProtocolVersion = HttpVersion.Version11; httpWebRequest.Method = "GET"; httpWebRequest.Accept = "*/* "; httpWebRequest.UserAgent = "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.56 Safari/536.5"; httpWebRequest.Referer = caijiUrl; httpWebRequest.ContentType = "keep-alive"; httpWebRequest.Host = "t5.mangafiles.com"; HttpWebResponse httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse(); System.Drawing.Image img; img = new System.Drawing.Bitmap(httpWebResponse.GetResponseStream());
你的IE是不是设置了代理?
设置过,但是没打开还有就是,我问过人家,人家说那个抓包工具打开的时候会设置代理,但是抓包工具打开的时候,才可以采集,说明那个代理设置的有效的啊……
@Death_Hacker;: 把你的 使用自动配置脚本 禁用掉。