procedure TForm1.Button1Click(Sender: TObject);<br>var<br>i:integer;<br>FileName,outname:string;<br>f:textfile;<br>begin<br>assignfile(f,'test.txt');<br>if FileExists(outname) then<br>append(f)<br>else<br>rewrite(f);<br>if opendialog1.Execute then begin<br>for i:=0 to OpenDialog1.Files.Count-1 do<br>begin<br> FileName:=ExtractFileName(OpenDialog1.Files);<br> writeln(f,filename);<br> //ShowMessage(FileName);<br>end;<br>end;<br>closefile(f);<br>end;<br>试试吧!!可以满足你的要求。