string;
[C#] 纯文本查看 复制代码 Random rd = new Random();
oneUrl += rd.NextDouble().ToString();
Uri uri = new Uri(oneUrl);
myHttpWebRequest = (HttpWebRequest)WebRequest.Create(uri);//请求的URL
myHttpWebRequest.CookieContainer = Cookies;//*发送COOKIE
myHttpWebRequest.Method = "GET";
myHttpWebRequest.ContentType = "application/x-www-form-urlencoded";
myHttpWebRequest.Referer = "http:// www. bjguahao.gov.cn/comm/index.html";
//获取返回资源
HttpWebResponse response = (HttpWebResponse)myHttpWebRequest.GetResponse();
//得到验证码数据流
Stream resStream = response.GetResponseStream();
//获取流
Bitmap bitmapImage = new Bitmap(resStream)
我获取bjguahao的验证码总是空白,
浏览器直接打开也是空白,而12306的验证码浏览器打开是有内容的
求高手帮助
|