System::IO::File::ReadAllText 方法

File::ReadAllText method

使用指定的字符编码将指定文本文件的内容读取为单个 String 对象。

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

ReturnValue

包含指定文件内容的字符串

另见