FileInfo.AppendText Method ()

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Creates a StreamWriter that appends text to the file represented by this instance of the FileInfo.

Namespace:   System.IO
Assembly:  mscorlib (in mscorlib.dll)

member AppendText : unit -> StreamWriter

Return Value

Type: System.IO.StreamWriter

A new StreamWriter.

The following example appends text to a file and reads from the file.

No code example is currently available or this language may not be supported.

The following example demonstrates appending text to the end of a file and also displays the result of the append operation to the console. The first time this routine is called, the file is created if it does not exist. After that, the specified text is appended to the file.

No code example is currently available or this language may not be supported.

FileIOPermission

for reading and appending to files. Associated enumerations: FileIOPermissionAccess.Read, FileIOPermissionAccess.Append

Universal Windows Platform
Available since 10
.NET Framework
Available since 1.1
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Return to top
Show: