Use the correct constructor:
else if (File.Exists(path))
{
using(var sw = new StreamWriter(path, true))
{
sw.WriteLine("The next line!");
}
}
More Related Contents:
- How to print a specific string after you split the line from text file (closed) [closed]
- What’s the fastest way to read a text file line-by-line?
- How to delete a line from a text file in C#?
- Determine the number of lines within a text file
- Getting all file names from a folder using C# [duplicate]
- Delete specific line from a text file?
- How to add new line into txt file
- Create Text File Without BOM
- Getting same numbers from random number generator even though it’s out of the loop. Why? [closed]
- Why are mutable structs “evil”?
- Using async-await on .net 4
- Best way to remove duplicate entries from a data table
- How can I get every nth item from a List?
- Is there a built-in method to compare collections?
- How to decode a Unicode character in a string
- Task continuation on UI thread
- How to communicate with a windows service?
- How to enable Nullable Reference Types feature of C# 8.0 for the whole project
- Where can I find the assembly System.Web.Extensions dll?
- Use linq to generate direct update without select
- When NOT to use yield (return) [duplicate]
- Checking if an object is a number in C#
- Difference between Char.IsDigit() and Char.IsNumber() in C#
- Using extension methods in .NET 2.0?
- How to make an HTTP get request with parameters
- C# – Convert WPF Image.source to a System.Drawing.Bitmap
- C# Convert List to Dictionary
- How to set property value using Expressions? [duplicate]
- How do I resolve the value of a databinding inside a MarkupExtension?
- DataTable to List