<?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: How To User StreamReader to Open A File ReadOnly in C# (.NET)</title>
	<atom:link href="http://peterkellner.net/2009/12/07/csharp-streamreader-readonly/feed/" rel="self" type="application/rss+xml" />
	<link>http://peterkellner.net/2009/12/07/csharp-streamreader-readonly/</link>
	<description>Microsoft Focussed, JavaScript (ExtJS, SenchaTouch &#38; Windows 8 Metro)</description>
	<lastBuildDate>Wed, 08 Feb 2012 21:38:46 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Ben</title>
		<link>http://peterkellner.net/2009/12/07/csharp-streamreader-readonly/comment-page-1/#comment-30998</link>
		<dc:creator>Ben</dc:creator>
		<pubDate>Thu, 06 Oct 2011 21:46:28 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/2009/12/07/csharp-streamreader-readonly/#comment-30998</guid>
		<description>I beleive that you want to do something like this

using( FileStream s = File.OpenRead(filename))
{
   using(TextReader reader = new StreamReader(s))
   {
     // Do smoething
   }
}

This ensures the both streams get closed properly.

Cheers
Ben</description>
		<content:encoded><![CDATA[<p>I beleive that you want to do something like this</p>
<p>using( FileStream s = File.OpenRead(filename))<br />
{<br />
   using(TextReader reader = new StreamReader(s))<br />
   {<br />
     // Do smoething<br />
   }<br />
}</p>
<p>This ensures the both streams get closed properly.</p>
<p>Cheers<br />
Ben</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MarkJoel60</title>
		<link>http://peterkellner.net/2009/12/07/csharp-streamreader-readonly/comment-page-1/#comment-30407</link>
		<dc:creator>MarkJoel60</dc:creator>
		<pubDate>Wed, 17 Aug 2011 19:47:18 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/2009/12/07/csharp-streamreader-readonly/#comment-30407</guid>
		<description>@Ash: I believe you are incorrect. I am using VS2010, and this works:


System.IO.StreamReader streamReader = new              System.IO.StreamReader(System.IO.File.OpenRead(&quot;myfile.txt&quot;));</description>
		<content:encoded><![CDATA[<p>@Ash: I believe you are incorrect. I am using VS2010, and this works:</p>
<p>System.IO.StreamReader streamReader = new              System.IO.StreamReader(System.IO.File.OpenRead(&#8220;myfile.txt&#8221;));</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ash</title>
		<link>http://peterkellner.net/2009/12/07/csharp-streamreader-readonly/comment-page-1/#comment-27822</link>
		<dc:creator>Ash</dc:creator>
		<pubDate>Fri, 23 Jul 2010 18:27:44 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/2009/12/07/csharp-streamreader-readonly/#comment-27822</guid>
		<description>File.OpenRead(file) .. doesn&#039;t seem to work in VS 2010 C#. The only option (in Intellisense) I get is file.OpenFile no file.openRead. Any thoughts?</description>
		<content:encoded><![CDATA[<p>File.OpenRead(file) .. doesn&#8217;t seem to work in VS 2010 C#. The only option (in Intellisense) I get is file.OpenFile no file.openRead. Any thoughts?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter</title>
		<link>http://peterkellner.net/2009/12/07/csharp-streamreader-readonly/comment-page-1/#comment-25868</link>
		<dc:creator>Peter</dc:creator>
		<pubDate>Tue, 08 Dec 2009 20:06:55 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/2009/12/07/csharp-streamreader-readonly/#comment-25868</guid>
		<description>Hi Ryan,
Sorry, don&#039;t know about performance, but I&#039;d guess opening in ReadOnly has not perf impact.
-Peter</description>
		<content:encoded><![CDATA[<p>Hi Ryan,<br />
Sorry, don&#8217;t know about performance, but I&#8217;d guess opening in ReadOnly has not perf impact.<br />
-Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ryan</title>
		<link>http://peterkellner.net/2009/12/07/csharp-streamreader-readonly/comment-page-1/#comment-25867</link>
		<dc:creator>Ryan</dc:creator>
		<pubDate>Tue, 08 Dec 2009 20:06:03 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/2009/12/07/csharp-streamreader-readonly/#comment-25867</guid>
		<description>Nice, I did not know of that static method.

Do you know if it improves performance/memory if opening a file for reading purposes only vs. opening it in RW mode?</description>
		<content:encoded><![CDATA[<p>Nice, I did not know of that static method.</p>
<p>Do you know if it improves performance/memory if opening a file for reading purposes only vs. opening it in RW mode?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bartek</title>
		<link>http://peterkellner.net/2009/12/07/csharp-streamreader-readonly/comment-page-1/#comment-25862</link>
		<dc:creator>Bartek</dc:creator>
		<pubDate>Tue, 08 Dec 2009 12:03:21 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/2009/12/07/csharp-streamreader-readonly/#comment-25862</guid>
		<description>Thanks Peter, I was just looking for something like this!</description>
		<content:encoded><![CDATA[<p>Thanks Peter, I was just looking for something like this!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced)
Database Caching 1/25 queries in 0.007 seconds using disk

Served from: peterkellner.net @ 2012-02-10 05:53:55 -->
