Compartir a través de


File.WriteAllLines Method

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Include Protected Members
Include Inherited Members

Include Silverlight Members
Include Silverlight for Windows Phone Members
Include XNA Framework Members

When it is called by a trusted application, creates a new file, writes the specified string to the file, and then closes the file. If the target file already exists, it is overwritten.

This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.

Overload List

  Name Description
Public methodStatic member WriteAllLines(String, IEnumerable<String>) When it is called by trusted applications, creates a new file, writes a collection of strings to the file, and then closes the file.
Public methodStatic member WriteAllLines(String, IEnumerable<String>, Encoding) When it is called by trusted applications, creates a new file by using the specified encoding, writes a collection of strings to the file, and then closes the file.

Top

See Also

Reference