var
PicFileSize,PFile,i:integer;
FSize,FDateTime:String;
LV:TListItem;
begin
For i:=1 to FileListBox.Items.Count do
begin
try
if DirPath<>SV.Directory then Break;
LV:=ListView.Items.Add;
LV.Caption:=FileListBox.Items.Strings[i-1];
LV.ImageIndex:=GetFileIcoIndex(FileListBox.Items.Strings[i-1]);
Repeat
PFile:=FileOpen(FileListBox.Items.Strings[i-1], fmOpenRead);
until PFile<>-1;
FDateTime:=DateTimeToStr(FileDateToDateTime(FileGetDate(PFile)));
PicFileSize:=FileSeek(PFile,0,2);
FileClose(PFile);
if PicFileSize<1024 then
FSize:=inttostr(PicFileSize)+' 字节'
else if PicFileSize<1048576 then
FSize:=floattostr(Trunc(PicFileSize/102.4)/10)+' KB'
else
FSize:=floattostr(Trunc(PicFileSize/104857.6)/10)+' MB';
LV.SubItems.Add(FSize);
LV.SubItems.Add(FDateTime);
except
Continue;
end;
Application.ProcessMessages;
end;
end;