File: AppendAllText

AppendAllText

Append a text string to the end of a specified file using the supplied encoding.

 Public Sub AppendAllText(
	  ByVal Path As String,
	  ByVal Contents As String,
	  Optional ByVal Encoding As Encoding )

Parameters

Path
[ByVal] String. The file to append the text to.
Contents
[ByVal] String. The string to append to the file.
Encoding
[ByVal] Optional. Encoding. The encoding used to encode the contents (Default UTF8).

Remarks

This method opens a file, appends the contents then closes the file in the call. If multiple lines need to be appended, then using this method may have performance problems.

If the file doesnt exist it will be created. If the file already exists, it will be overwritten.

See Also

Project VBCorLib Overview | Class File Overview