<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Read a Web Page in C#</title>
	<atom:link href="http://www.csharp411.com/read-a-web-page-in-c/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.csharp411.com/read-a-web-page-in-c/</link>
	<description>C# Information, Code, Tips and News</description>
	<lastBuildDate>Sat, 24 Jul 2010 01:26:51 -0400</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: israeli guy</title>
		<link>http://www.csharp411.com/read-a-web-page-in-c/comment-page-1/#comment-5369</link>
		<dc:creator>israeli guy</dc:creator>
		<pubDate>Wed, 27 Jan 2010 17:32:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.mini-tools.com/at2/csharp/wordpress/read-a-web-page-in-c/#comment-5369</guid>
		<description>Thanks a bunch man you helped me a lot with that simple example i appreciate it ! 

israeli guy</description>
		<content:encoded><![CDATA[<p>Thanks a bunch man you helped me a lot with that simple example i appreciate it ! </p>
<p>israeli guy</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: George</title>
		<link>http://www.csharp411.com/read-a-web-page-in-c/comment-page-1/#comment-5346</link>
		<dc:creator>George</dc:creator>
		<pubDate>Tue, 22 Dec 2009 02:07:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.mini-tools.com/at2/csharp/wordpress/read-a-web-page-in-c/#comment-5346</guid>
		<description>@denny: The code above will do it for you.  Just replace the url string literal, such as:

string url = &quot;http://www.mywebsite.com/xyz.txt&quot;;</description>
		<content:encoded><![CDATA[<p>@denny: The code above will do it for you.  Just replace the url string literal, such as:</p>
<p>string url = "http://www.mywebsite.com/xyz.txt";</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: denny</title>
		<link>http://www.csharp411.com/read-a-web-page-in-c/comment-page-1/#comment-5345</link>
		<dc:creator>denny</dc:creator>
		<pubDate>Tue, 22 Dec 2009 00:32:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.mini-tools.com/at2/csharp/wordpress/read-a-web-page-in-c/#comment-5345</guid>
		<description>hello

Can I place a text file (xyz.txt)  in my own url
and then whereever I go I can download it into string[] using c# ?
can u suggest the code ?</description>
		<content:encoded><![CDATA[<p>hello</p>
<p>Can I place a text file (xyz.txt)  in my own url<br />
and then whereever I go I can download it into string[] using c# ?<br />
can u suggest the code ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eamon Nerbonne</title>
		<link>http://www.csharp411.com/read-a-web-page-in-c/comment-page-1/#comment-5317</link>
		<dc:creator>Eamon Nerbonne</dc:creator>
		<pubDate>Tue, 27 Oct 2009 12:53:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.mini-tools.com/at2/csharp/wordpress/read-a-web-page-in-c/#comment-5317</guid>
		<description>I know this is a somewhat old post, but nevertheless...

I always strongly suggest avoiding WebClient for everything but one-time-only scripting usage.  WebClient is unfortunately not properly encoding-aware, and it trashes the relevant HTTP headers so you cannot manually determine the correct encoding should it fail.  Essentially, when WebClient doesn&#039;t find an encoding specified as a charset, it uses your local system&#039;s default codepage, which is generally not what you want.

To avoid potential data-corruption issues, I&#039;d avoid it.</description>
		<content:encoded><![CDATA[<p>I know this is a somewhat old post, but nevertheless&#8230;</p>
<p>I always strongly suggest avoiding WebClient for everything but one-time-only scripting usage.  WebClient is unfortunately not properly encoding-aware, and it trashes the relevant HTTP headers so you cannot manually determine the correct encoding should it fail.  Essentially, when WebClient doesn't find an encoding specified as a charset, it uses your local system's default codepage, which is generally not what you want.</p>
<p>To avoid potential data-corruption issues, I'd avoid it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andy Bruce</title>
		<link>http://www.csharp411.com/read-a-web-page-in-c/comment-page-1/#comment-5294</link>
		<dc:creator>Andy Bruce</dc:creator>
		<pubDate>Wed, 30 Sep 2009 19:31:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.mini-tools.com/at2/csharp/wordpress/read-a-web-page-in-c/#comment-5294</guid>
		<description>Please--remember that if an object supports IDisposable you should *always* invoke Dispose. Since that&#039;s not convenient, instead wrap the code in using block like this:

Uri target = new Uri(LocalTestPagesFullURL + &quot;/&quot; + relative_path);
LH.info(&quot;Running test for &quot;, target);
using (System.Net.WebClient client = new System.Net.WebClient())
{
  byte[] data = client.DownloadData(target);
} //using

Don&#039;t think you need to do this? Keep writing code, you&#039;ll find out for yourself at 2am...</description>
		<content:encoded><![CDATA[<p>Please&#8211;remember that if an object supports IDisposable you should *always* invoke Dispose. Since that's not convenient, instead wrap the code in using block like this:</p>
<p>Uri target = new Uri(LocalTestPagesFullURL + "/" + relative_path);<br />
LH.info("Running test for ", target);<br />
using (System.Net.WebClient client = new System.Net.WebClient())<br />
{<br />
  byte[] data = client.DownloadData(target);<br />
} //using</p>
<p>Don't think you need to do this? Keep writing code, you'll find out for yourself at 2am&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Athan</title>
		<link>http://www.csharp411.com/read-a-web-page-in-c/comment-page-1/#comment-80</link>
		<dc:creator>Athan</dc:creator>
		<pubDate>Tue, 12 Feb 2008 15:56:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.mini-tools.com/at2/csharp/wordpress/read-a-web-page-in-c/#comment-80</guid>
		<description>Sorry :(</description>
		<content:encoded><![CDATA[<p>Sorry <img src='http://www.csharp411.com/wordpress/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John</title>
		<link>http://www.csharp411.com/read-a-web-page-in-c/comment-page-1/#comment-79</link>
		<dc:creator>John</dc:creator>
		<pubDate>Mon, 14 Jan 2008 21:07:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.mini-tools.com/at2/csharp/wordpress/read-a-web-page-in-c/#comment-79</guid>
		<description>You can also add headers in both WebClient and HttpWebRequest. Take a look at http://msdn2.microsoft.com/en-us/library/system.net.webclient.aspx and http://msdn2.microsoft.com/en-us/library/system.net.httpwebrequest.headers(VS.85).aspx</description>
		<content:encoded><![CDATA[<p>You can also add headers in both WebClient and HttpWebRequest. Take a look at <a href="http://msdn2.microsoft.com/en-us/library/system.net.webclient.aspx" rel="nofollow">http://msdn2.microsoft.com/en-us/library/system.net.webclient.aspx</a> and <a href="http://msdn2.microsoft.com/en-us/library/system.net.httpwebrequest.headers(VS.85).aspx" rel="nofollow">http://msdn2.microsoft.com/en-us/library/system.net.httpwebrequest.headers(VS.85).aspx</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
