<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>C# 411 &#187; IO</title>
	<atom:link href="http://www.csharp411.com/category/io/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.csharp411.com</link>
	<description>C# Development</description>
	<lastBuildDate>Sat, 19 Nov 2011 19:34:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Force XmlWriter or XmlTextWriter to use Encoding Other Than UTF-16</title>
		<link>http://www.csharp411.com/how-to-force-xmlwriter-or-xmltextwriter-to-use-encoding-other-than-utf-16/</link>
		<comments>http://www.csharp411.com/how-to-force-xmlwriter-or-xmltextwriter-to-use-encoding-other-than-utf-16/#comments</comments>
		<pubDate>Wed, 26 Jan 2011 16:52:50 +0000</pubDate>
		<dc:creator>Timm</dc:creator>
				<category><![CDATA[IO]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.csharp411.com/how-to-force-xmlwriter-or-xmltextwriter-to-use-encoding-other-than-utf-16/</guid>
		<description><![CDATA[You may have noticed the first line of XML output generated by XmlWriter or XmlTextWriter shows that the encoding defaults to UTF-16: &#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-16&#34;?&#62; This happens even if you explicitly set the Encoding property in the XmlWriterSettings to something different, such as UTF-8: The problem occurs because the StringWriter defaults to UTF-16.&#160; (It’s not [...]]]></description>
		<wfw:commentRss>http://www.csharp411.com/how-to-force-xmlwriter-or-xmltextwriter-to-use-encoding-other-than-utf-16/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Rename a File in C#</title>
		<link>http://www.csharp411.com/rename-a-file-in-c/</link>
		<comments>http://www.csharp411.com/rename-a-file-in-c/#comments</comments>
		<pubDate>Fri, 14 Jan 2011 00:14:19 +0000</pubDate>
		<dc:creator>Timm</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[IO]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.csharp411.com/rename-a-file-in-c/</guid>
		<description><![CDATA[If you want to rename a file in C#, you’d expect there to be a File.Rename method, but instead you must use the System.IO.File.Move method.&#160; You must also handle a special case when the new file name has the same letters but with difference case.&#160; For example, if you want to rename “test.doc” to “Test.doc”, [...]]]></description>
		<wfw:commentRss>http://www.csharp411.com/rename-a-file-in-c/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Get Temporary Directory</title>
		<link>http://www.csharp411.com/get-temporary-directory/</link>
		<comments>http://www.csharp411.com/get-temporary-directory/#comments</comments>
		<pubDate>Sat, 01 May 2010 15:32:05 +0000</pubDate>
		<dc:creator>Timm</dc:creator>
				<category><![CDATA[IO]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.csharp411.com/get-temporary-directory/</guid>
		<description><![CDATA[To get the path of the current user&#8217;s temporary folder, call the GetTempPath method in the System.IO namespace: string tempPath = System.IO.Path.GetTempPath(); On Windows Vista and 7, this method will return the following path: C:UsersUserNameAppDataLocalTemp]]></description>
		<wfw:commentRss>http://www.csharp411.com/get-temporary-directory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Read File into Byte Array</title>
		<link>http://www.csharp411.com/read-file-into-byte-array/</link>
		<comments>http://www.csharp411.com/read-file-into-byte-array/#comments</comments>
		<pubDate>Wed, 21 Apr 2010 20:13:37 +0000</pubDate>
		<dc:creator>Timm</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[IO]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.csharp411.com/read-file-into-byte-array/</guid>
		<description><![CDATA[It’s easy to read a file into a byte array.&#160; Just use the File.ReadAllBytes static method.&#160; This opens a binary file in read-only mode, reads the contents of the file into a byte array, and then closes the file. string filePath = @&#34;C:test.doc&#34;; byte[] byteArray = File.ReadAllBytes( filePath );]]></description>
		<wfw:commentRss>http://www.csharp411.com/read-file-into-byte-array/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Set InitialDirectory for FolderBrowserDialog</title>
		<link>http://www.csharp411.com/set-initialdirectory-for-folderbrowserdialog/</link>
		<comments>http://www.csharp411.com/set-initialdirectory-for-folderbrowserdialog/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 20:34:40 +0000</pubDate>
		<dc:creator>Timm</dc:creator>
				<category><![CDATA[IO]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Windows Forms]]></category>

		<guid isPermaLink="false">http://www.csharp411.com/set-initialdirectory-for-folderbrowserdialog/</guid>
		<description><![CDATA[The .NET FolderBrowserDialog class does not have an InitialDirectory property like the OpenFileDialog class.&#160; But fortunately, it’s quite easy to set an initial folder in the FolderBrowserDialog: FolderBrowserDialog dialog = new FolderBrowserDialog(); dialog.RootFolder = Environment.SpecialFolder.Desktop; dialog.SelectedPath = @&#34;C:Program Files&#34;; if (dialog.ShowDialog() == DialogResult.OK) { Console.WriteLine( dialog.SelectedPath ); } Note that you can choose other RootFolder’s [...]]]></description>
		<wfw:commentRss>http://www.csharp411.com/set-initialdirectory-for-folderbrowserdialog/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>C# Read String Line by Line</title>
		<link>http://www.csharp411.com/c-read-string-line-by-line/</link>
		<comments>http://www.csharp411.com/c-read-string-line-by-line/#comments</comments>
		<pubDate>Fri, 20 Feb 2009 14:48:54 +0000</pubDate>
		<dc:creator>Timm</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[IO]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.csharp411.com/c-read-string-line-by-line/</guid>
		<description><![CDATA[It’s easy to read a string one line at a time.&#160; Here is a console program that demonstrates how:]]></description>
		<wfw:commentRss>http://www.csharp411.com/c-read-string-line-by-line/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>C# Convert String to Stream, and Stream to String</title>
		<link>http://www.csharp411.com/c-convert-string-to-stream-and-stream-to-string/</link>
		<comments>http://www.csharp411.com/c-convert-string-to-stream-and-stream-to-string/#comments</comments>
		<pubDate>Thu, 19 Feb 2009 22:20:43 +0000</pubDate>
		<dc:creator>Timm</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[IO]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.csharp411.com/c-convert-string-to-stream-and-stream-to-string/</guid>
		<description><![CDATA[It’s fairly easy to convert a C# String to a Stream and vice-versa. Convert String to Stream To convert a C# String to a MemoryStream object, use the GetBytes Encoding method to create a byte array, then pass that to the MemoryStream constructor: Convert Stream to String To convert a Stream object (or any of [...]]]></description>
		<wfw:commentRss>http://www.csharp411.com/c-convert-string-to-stream-and-stream-to-string/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>C# Read Text File Line-by-Line</title>
		<link>http://www.csharp411.com/c-read-text-file-line-by-line/</link>
		<comments>http://www.csharp411.com/c-read-text-file-line-by-line/#comments</comments>
		<pubDate>Thu, 15 Jan 2009 15:29:48 +0000</pubDate>
		<dc:creator>Timm</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[IO]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.csharp411.com/c-read-text-file-line-by-line/</guid>
		<description><![CDATA[Here is the code to read a text file from disk one line at a time into a string.  This code ensures the file exists and properly closes the file if an exception occurs.]]></description>
		<wfw:commentRss>http://www.csharp411.com/c-read-text-file-line-by-line/feed/</wfw:commentRss>
		<slash:comments>28</slash:comments>
		</item>
		<item>
		<title>Check Valid File Path in C#</title>
		<link>http://www.csharp411.com/check-valid-file-path-in-c/</link>
		<comments>http://www.csharp411.com/check-valid-file-path-in-c/#comments</comments>
		<pubDate>Thu, 17 Jul 2008 12:45:06 +0000</pubDate>
		<dc:creator>Timm</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[IO]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.csharp411.com/check-valid-file-path-in-c/</guid>
		<description><![CDATA[It&#8217;s not a trivial exercise to validate a file path on a Windows PC.  There are a few special cases depending on the file system and operating subsystem: NTFS and the Posix file systems are the most permissive.  A file name may contain up to 32,768 Unicode characters, trailing periods, trailing spaces, and two files [...]]]></description>
		<wfw:commentRss>http://www.csharp411.com/check-valid-file-path-in-c/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Display an RTF File that&#8217;s a C# Embedded Resource</title>
		<link>http://www.csharp411.com/display-an-rtf-file-thats-a-c-embedded-resource/</link>
		<comments>http://www.csharp411.com/display-an-rtf-file-thats-a-c-embedded-resource/#comments</comments>
		<pubDate>Wed, 16 Jul 2008 13:59:27 +0000</pubDate>
		<dc:creator>Timm</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Controls]]></category>
		<category><![CDATA[IO]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.csharp411.com/display-an-rtf-file-thats-a-c-embedded-resource/</guid>
		<description><![CDATA[It&#8217;s easy to display an RTF file &#8212; that was embedded as a resource in a C# program &#8212; in a Windows Form RichTextControl. First, include the following references: Next, load the RTF that you have embedded in your Visual Studio project: The trickiest part of loading an embedded resource is getting the correct path.  [...]]]></description>
		<wfw:commentRss>http://www.csharp411.com/display-an-rtf-file-thats-a-c-embedded-resource/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

