File: WriteAllText

WriteAllText

Opens a files, writes out all contents to the file, then closes the file.



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

Parameters

Path
[ByVal] String. The path and filename of the file to write to.
Contents
[ByVal] String. The contents to write to the file.
Encoding
[ByVal] Optional. Encoding. The encoding to be used when writing to the file.

Remarks

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

See Also

Project VBCorLib Overview Class File Overview File Properties File Methods WriteAllLines