반응형
var
data : String;
fStream : TFileStream;
mStream : TMemoryStream;
sStream : TStringStream;
begin
try
fStream := TFileStream.Create('파일이름', fmOpenRead);
mStream := TMemoryStream.Create;
sStream := TStringStream.Create('');
mStream.LoadFromStream(fStream);
mStream.SaveToStream(sStream);
data := sStream.DataString;
finally
sStream.Destroy;
fStream.Destroy;
mStream.Destroy;
end;
end;
data : String;
fStream : TFileStream;
mStream : TMemoryStream;
sStream : TStringStream;
begin
try
fStream := TFileStream.Create('파일이름', fmOpenRead);
mStream := TMemoryStream.Create;
sStream := TStringStream.Create('');
mStream.LoadFromStream(fStream);
mStream.SaveToStream(sStream);
data := sStream.DataString;
finally
sStream.Destroy;
fStream.Destroy;
mStream.Destroy;
end;
end;
반응형