System::IO::File::AppendAllLines 方法

File::AppendAllLines method

使用指定的编码,将指定字符串集合中的字符串逐行追加到指定文件中,每个字符串写入新的一行。如果指定的文件不存在,则会创建该文件。写入所有字符串后关闭文件。

static void System::IO::File::AppendAllLines(const String &path, const SharedPtr<Collections::Generic::IEnumerable<String>> &contents, const EncodingPtr &encoding=Text::Encoding::get_UTF8Unmarked())
参数类型描述
路径const String&要追加字符串的文件路径
内容const SharedPtr<Collections::Generic::IEnumerable<String>>&要写入文件的字符串
encodingconst EncodingPtr&要使用的字符编码

另见