System::IO::File::OpenText 方法

File::OpenText method

以 UTF-8 编码打开指定的现有文件读取文本,且不共享。

static StreamReaderPtr System::IO::File::OpenText(const String &path, const EncodingPtr &encoding=Text::Encoding::get_UTF8Unmarked())
ParameterType描述
路径const String&要打开的文件路径
encodingconst EncodingPtr&要使用的字符编码

ReturnValue

一个指向与已打开文件关联的 StreamWriter 对象的共享指针

另见