for i:=0 to (FileListBox1.Items.Count-1) do
begin
if FileListBox1.Selected=true then
assignfile(txt2,path1+FilelistBox1.Items.strings)
else
assignfile(txt2,path1+FilelistBox1.Items);
reset(txt2);
while not eof(txt2) do
begin
.....
end;
end;
是不是这样,可是不行,跳过了assignfile(txt2,path1+FilelistBox1.Items.strings),
执行else中的assignfile(txt2,path1+FilelistBox1.Items);
也就是说FilelistBox1显示的文件都读写了.