K
kenneth
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.N9Click(Sender: TObject);
Var F:TextFile;
M:Integer;
begin
If SaveDialog1.Execute then
If SaveDialog1.FileName<>'' then
begin
AssignFile(F,SaveDialog1.FileName);
Rewrite(F);
SaveDialog1.DefaultExt :='.txt';
for M :=0 to listbox1.Items.Count-1 do
begin
Writeln(F,listbox1.Items.strings[m]);
end;
CloseFile(F)
end
end;
为什么我这样保存的文件的扩展名不会为.txt的,错在哪里?请指点
Var F:TextFile;
M:Integer;
begin
If SaveDialog1.Execute then
If SaveDialog1.FileName<>'' then
begin
AssignFile(F,SaveDialog1.FileName);
Rewrite(F);
SaveDialog1.DefaultExt :='.txt';
for M :=0 to listbox1.Items.Count-1 do
begin
Writeln(F,listbox1.Items.strings[m]);
end;
CloseFile(F)
end
end;
为什么我这样保存的文件的扩展名不会为.txt的,错在哪里?请指点