File.WriteAllText 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, write the contents 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 WriteAllText(String, String) When it is called by trusted applications, 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.
Public methodStatic member WriteAllText(String, String, Encoding) When it is called by trusted applications, creates a new file, writes the specified string to the file using the specified encoding, and then closes the file. If the target file already exists, it is overwritten.

Top

See Also

Reference