Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>MSDN provides examples of how to do both things</p> <ul> <li><a href="http://msdn.microsoft.com/en-us/library/6ka1wd3w.aspx" rel="nofollow noreferrer">How to: Write Text to a File</a></li> <li><a href="http://msdn.microsoft.com/en-us/library/db5x7c0d.aspx" rel="nofollow noreferrer">How to: Read Text from a File</a></li> </ul> <p>As you can see from he examples, you don't need to convert strings into arrays of characters to write them.</p> <p>You will also notice both example using the <a href="http://msdn.microsoft.com/en-us/library/yh598w02.aspx" rel="nofollow noreferrer"><code>using</code></a> keyword. There's an explanation of why you want to use that construct in this question (and probably many others): <a href="https://stackoverflow.com/questions/567138/when-should-i-use-using-blocks-in-c">When should I use “using” blocks in C#?</a></p> <p>It looks like you already fond the <a href="http://msdn.microsoft.com/en-us/library/3saad2h5.aspx" rel="nofollow noreferrer"><code>File</code></a> class, you could take advantage of the other methods in it that are specifically designed for working with text files. You can decide if you want to write to/read from a file in terms of lines or entire contents. There are examples of how to use the <code>File</code> class here:</p> <ul> <li><a href="http://msdn.microsoft.com/en-us/library/8bh11f1k" rel="nofollow noreferrer">How to: Write to a Text File</a></li> <li><a href="http://msdn.microsoft.com/en-us/library/ezwyzy7b" rel="nofollow noreferrer">How to: Read From a Text File</a></li> </ul> <hr> <p>Based on the code it looks like you're just starting out with programming, consider putting your code up <a href="https://codereview.stackexchange.com/">CodeReview</a>. That way you can get helpful tips about how to write better code. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload