爬百度、GOOGLE都可以,为什么这个URL不行?
http://softbbs.pconline.com.cn/f592975.html以下是相关代码,高手帮帮忙。
StringBuilder sb = new StringBuilder("http://softbbs.pconline.com.cn/f592975.html");
CookieContainer cc = new CookieContainer();
try
{
HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create(sb.ToString());
myReq.Method = "GET";
myReq.CookieContainer = cc;
HttpWebResponse resp = myReq.GetResponse() as HttpWebResponse;
Stream s = resp.GetResponseStream();
StreamReader sr = new StreamReader(s,System.Text.Encoding.Default);
String text = sr.ReadToEnd();
Console.WriteLine(text);
sr.Close();
s.Close();
}
catch (Exception ex)
{
StreamWriter sw = new StreamWriter(@"d:\url.txt", true);
string s = ex.ToString();
sw.WriteLine(s);
sw.Close();
}
http://softbbs.pconline.com.cn/f592975.html以下是相关代码,高手帮帮忙。
StringBuilder sb = new StringBuilder("http://softbbs.pconline.com.cn/f592975.html");
CookieContainer cc = new CookieContainer();
try
{
HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create(sb.ToString());
myReq.Method = "GET";
myReq.CookieContainer = cc;
HttpWebResponse resp = myReq.GetResponse() as HttpWebResponse;
Stream s = resp.GetResponseStream();
StreamReader sr = new StreamReader(s,System.Text.Encoding.Default);
String text = sr.ReadToEnd();
Console.WriteLine(text);
sr.Close();
s.Close();
}
catch (Exception ex)
{
StreamWriter sw = new StreamWriter(@"d:\url.txt", true);
string s = ex.ToString();
sw.WriteLine(s);
sw.Close();
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货