streamWriter.Write("foo");
...is going to replace everything in a file with merely "foo" while...
streamWriter.WriteLine("bar");
...is just going to append "bar" on a separate line following everything else. There is another difference however, all lines written with .WriteLine are followed by a carriage return, like it or not, but a carriage return does not chase a write with .Write. You have to append \r\n to what you write with .Write to put it there. Well, that is if you want it to begin with.
No comments:
Post a Comment