ReadAllText()

File::ReadAllText(const String&, const EncodingPtr&) method

Reads the content of the specified text file to a single String object using the specified character encoding.

static String System::IO::File::ReadAllText(const String &path, const EncodingPtr &encoding=Text::Encoding::get_UTF8())

Arguments

ParameterTypeDescription
pathconst String&The path of the file to read
encodingconst EncodingPtr&The character encoding to use

Return Value

A string containing the content of the specified file

See Also