<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://wiki.twig.es/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.twig.es/index.php?action=history&amp;feed=atom&amp;title=Readng_text_files_in_c</id>
		<title>Readng text files in c - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.twig.es/index.php?action=history&amp;feed=atom&amp;title=Readng_text_files_in_c"/>
		<link rel="alternate" type="text/html" href="https://wiki.twig.es/index.php?title=Readng_text_files_in_c&amp;action=history"/>
		<updated>2026-05-06T15:53:31Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.23.0</generator>

	<entry>
		<id>https://wiki.twig.es/index.php?title=Readng_text_files_in_c&amp;diff=1770&amp;oldid=prev</id>
		<title>George2: Created page with &quot;&lt;source lang=&quot;csharp&quot;&gt;  class ReadFromFile {     static void Main()     {         // The files used in this example are created in the topic          // How to: Write to a Tex...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.twig.es/index.php?title=Readng_text_files_in_c&amp;diff=1770&amp;oldid=prev"/>
				<updated>2015-03-27T21:23:48Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;  class ReadFromFile {     static void Main()     {         // The files used in this example are created in the topic          // How to: Write to a Tex...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
class ReadFromFile&lt;br /&gt;
{&lt;br /&gt;
    static void Main()&lt;br /&gt;
    {&lt;br /&gt;
        // The files used in this example are created in the topic &lt;br /&gt;
        // How to: Write to a Text File. You can change the path and &lt;br /&gt;
        // file name to substitute text files of your own. &lt;br /&gt;
&lt;br /&gt;
        // Example #1 &lt;br /&gt;
        // Read the file as one string. &lt;br /&gt;
        string text = System.IO.File.ReadAllText(@&amp;quot;C:\Users\Public\TestFolder\WriteText.txt&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
        // Display the file contents to the console. Variable text is a string.&lt;br /&gt;
        System.Console.WriteLine(&amp;quot;Contents of WriteText.txt = {0}&amp;quot;, text);&lt;br /&gt;
&lt;br /&gt;
        // Example #2 &lt;br /&gt;
        // Read each line of the file into a string array. Each element &lt;br /&gt;
        // of the array is one line of the file. &lt;br /&gt;
        string[] lines = System.IO.File.ReadAllLines(@&amp;quot;C:\Users\Public\TestFolder\WriteLines2.txt&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
        // Display the file contents by using a foreach loop.&lt;br /&gt;
        System.Console.WriteLine(&amp;quot;Contents of WriteLines2.txt = &amp;quot;);&lt;br /&gt;
        foreach (string line in lines)&lt;br /&gt;
        {&lt;br /&gt;
            // Use a tab to indent each line of the file.&lt;br /&gt;
            Console.WriteLine(&amp;quot;\t&amp;quot; + line);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // Keep the console window open in debug mode.&lt;br /&gt;
        Console.WriteLine(&amp;quot;Press any key to exit.&amp;quot;);&lt;br /&gt;
        System.Console.ReadKey();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;source&amp;gt;&lt;/div&gt;</summary>
		<author><name>George2</name></author>	</entry>

	</feed>