IFileInfo.OpenTextReader

Синтаксис

OpenTextReader: ITextReader;

Описание

Метод OpenTextReader открывает файл для чтения в текстовом виде.

Пример

Sub UserProc;
Var
    File1: IFileInfo;
    TextR: ITextReader;
    d: DateTime;
Begin
    File1:=New FileInfo.Attach("c:\Work\1.txt");
    If File1.Exists Then
        TextR:=File1.OpenTextReader;
        d:=TextR.ReadDateTime;
    End If;
    Dispose File1;
End Sub UserProc;

После выполнения примера в переменную «d» из файла «1.txt» будет считана дата и время.

См. также:

IFileInfo