File.WriteAllLines 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 new file, writes one or more strings to the file, and then closes the file.

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

NameDescription
System_CAPS_pubmethodSystem_CAPS_staticWriteAllLines(String, IEnumerable<String>)

Creates a new file, writes a collection of strings to the file, and then closes the file.

System_CAPS_pubmethodSystem_CAPS_staticWriteAllLines(String, IEnumerable<String>, Encoding)

Creates a new file by using the specified encoding, writes a collection of strings to the file, and then closes the file.

System_CAPS_pubmethodSystem_CAPS_staticWriteAllLines(String, String[])

Creates a new file, write the specified string array to the file, and then closes the file.

System_CAPS_pubmethodSystem_CAPS_staticWriteAllLines(String, String[], Encoding)

Creates a new file, writes the specified string array to the file by using the specified encoding, and then closes the file.

Return to top
Show: