System::IO::File::ReadAllLines 方法

File::ReadAllLines method

使用指定的字符编码逐行读取指定文本文件的内容到字符串数组中。

static ArrayPtr<String> System::IO::File::ReadAllLines(const String &path, const EncodingPtr &encoding=Text::Encoding::get_UTF8())
参数类型描述
路径const String&要读取的文件路径
encodingconst EncodingPtr&要使用的字符编码

ReturnValue

一个字符串数组,每个元素表示指定文件中的单独一行

另见