//需要引用System.IOUtils单元
procedure TForm7.Button3Click(Sender: TObject);
var
sFileName: string;
tstream: TStreamWriter;
begin
Memo1.Clear;
Memo1.Lines.Add(TPath.GetFileName(Application.ExeName));
Memo1.Lines.Add(TPath.GetDownloadsPath);
Memo1.Lines.Add(TPath.GetHomePath);
sFileName := TDirectory.GetCurrentDirectory + '' + '33333.txt';
if TFile.Exists(sFileName) then
TFile.Delete(sFileName);
tstream := TFile.CreateText(sFileName);
try
tstream.WriteLine('33333333333');
tstream.WriteLine('GBK中文显示不知道有没有问题!');
finally
tstream.Free;
end;
end;