Appends lines to a file, and then closes the file.
| C# | Visual Basic |
public static void AppendAllLines( string path, IEnumerable<string> contents )
Public Shared Sub AppendAllLines ( _ path As String, _ contents As IEnumerable(Of String) _ )
- path (String)
- The file to append the lines to. The file is created if it does not already exist.
- contents (IEnumerable<(Of <(<'String>)>)>)
- The lines to append to the file.
| Exception | Condition |
|---|---|
| ArgumentException | path is a zero-length string. |
| ArgumentNullException | Either path or contents is a null reference (Nothing in Visual Basic). |
| IOException | An I/O error occurred while opening the file. |