System::IO::File::WriteAllText 方法

File::WriteAllText method

创建新文本文件或覆盖已有文件,并使用指定的编码将指定字符串的内容写入文件。

static void System::IO::File::WriteAllText(const String &path, const String &contents, const EncodingPtr &encoding=Text::Encoding::get_UTF8Unmarked())
参数类型描述
路径const String&要创建或覆盖的文件
内容const String&字符串数组
encodingconst EncodingPtr&要使用的字符编码

另见