System.IOUtils.TFile.ReadAllLines
Delphi
class function ReadAllLines(const Path: string): TStringDynArray;
class function ReadAllLines(const Path: string; const Encoding: TEncoding): TStringDynArray; overload; static;
C++
static System::DynamicArray<System::UnicodeString> __fastcall ReadAllLines(const System::UnicodeString Path)/* overload */;
static System::DynamicArray<System::UnicodeString> __fastcall ReadAllLines(const System::UnicodeString Path, System::Sysutils::TEncoding* const Encoding)/* overload */;
プロパティ
種類 | 可視性 | ソース | ユニット | 親 |
---|---|---|---|---|
function | public | System.IOUtils.pas System.IOUtils.hpp |
System.IOUtils | TFile |
説明
テキスト ファイルの内容を読み取って文字列配列に格納します。
テキスト ファイルの内容を読み取るには ReadAllLines を使用します。ReadAllLines は、ファイルから読み取ったテキスト行を含む新しい文字列配列を返します。このメソッドに必要なパラメータの一覧を以下の表に示します。
名前 | 意味 |
---|---|
Path |
ファイルのパス。 |
Encoding |
ファイル内に含まれているテキストのエンコーディング。 |
メモ: ファイルを開けない場合やパスが無効な場合、ReadAllLines は例外を発生させます。