Procedure TForm1.Button1Click(Sender: TObject); begin if opendialog1.Execute then begin showmessage(opendialog1.Files.Text ); end; end;
注意在FILES中元素的顺序是和选择的顺序相反的;
if Opendialog.Execute then begin for i := 0 to OpenDialog.Files.Count - 1 do deal(OpenDialog.Fiels.Strings[i]) end;OpenDialog.Fiels.Strings[i]这个就是你要处理的文件名.
ShowMessage(OpenDialog.Files.Strings[IntegerValue]);如: For I := 0 to OpenDialog.Files.Count - 1 do begin With FindComponent('Edit' + IntToStr(I)) , OpenDialog.Fields do begin Text := Strings[I]; end; end;
begin if opendialog1.Execute then
begin
showmessage(opendialog1.Files.Text );
end;
end;
begin
for i := 0 to OpenDialog.Files.Count - 1 do
deal(OpenDialog.Fiels.Strings[i])
end;OpenDialog.Fiels.Strings[i]这个就是你要处理的文件名.
For I := 0 to OpenDialog.Files.Count - 1 do
begin
With FindComponent('Edit' + IntToStr(I)) , OpenDialog.Fields do
begin
Text := Strings[I];
end;
end;