如题
按照孟子E章的文章
http://dotnet.aspx.cc/ShowDetail.aspx?id=0A6660CE-4138-41EF-B882-15DB65564709大多数网页能解析获得网页原代码,但一部分会出现(404) NOT FOUND的异常,但这样网址能在IE中直接打开,搞了很久,找了很多资料,换了很多方法仍然不知道缘由,盼孟子E章帮忙,谢谢先附这样地址:
http://www.blogcn.com/rss2/06sg.xml
http://www.blogcn.com/rss2/liasura.xml
...
按照孟子E章的文章
http://dotnet.aspx.cc/ShowDetail.aspx?id=0A6660CE-4138-41EF-B882-15DB65564709大多数网页能解析获得网页原代码,但一部分会出现(404) NOT FOUND的异常,但这样网址能在IE中直接打开,搞了很久,找了很多资料,换了很多方法仍然不知道缘由,盼孟子E章帮忙,谢谢先附这样地址:
http://www.blogcn.com/rss2/06sg.xml
http://www.blogcn.com/rss2/liasura.xml
...
解决方案 »
- 求助:Server Error in '/' Application怎么解决?
- js处理图片的问题。。。。。。
- 上一篇 下一篇 的问题
- |zyciis| 在ASP.NET中如何让一个页面只能接收POST而不能接收GET
- datagrid中的两个列(车牌和车号)想合成一个列(车牌号)怎么做?
- 不知道高手们睡了没....
- 新手 求一段 dataset 对像的使用例子 !!!!!!!!!!!!!!!!!
- asp.net中如何在DataGrid的编辑状态下控制编辑框只能输入的是数字并判断保留两位小数
- 迷糊中啊
- 1.在ASP.NET(C#)中,怎样把HTML写入SQL SERVER数据库?
- Response.Write为什么报错?
- asp.net2.0中Button控件与CheckBox控件的问题
可以说的详细点吗?TO song1(银河):
谁解决了一样给分:)
string PageUrl = "http://www.blogcn.com/rss2/liasura.xml";
System.Net.HttpWebRequest request = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(PageUrl);
request.UserAgent = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.1) Web-Sniffer/1.0.24[CRLF";
request.ProtocolVersion = System.Net.HttpVersion.Version11;
System.Net.WebResponse response = request.GetResponse();
System.IO.Stream resStream = response.GetResponseStream();
System.IO.StreamReader sr = new System.IO.StreamReader(resStream, System.Text.Encoding.Default);
ContentHtml.Text = sr.ReadToEnd();
resStream.Close();
sr.Close();
System.Net.HttpWebRequest request = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(PageUrl);
request.UserAgent = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.1) Web-Sniffer/1.0.24";
System.Net.WebResponse response = request.GetResponse();
System.IO.Stream resStream = response.GetResponseStream();
System.IO.StreamReader sr = new System.IO.StreamReader(resStream, System.Text.Encoding.Default);
ContentHtml.Text = sr.ReadToEnd();
resStream.Close();
sr.Close();