我想实现在打开对话框里面选择多个文件然后拷贝到我的工程所在的文件夹下,选择多个文件之后,每个文件的文件名怎么获得,如何实现,谢谢!
解决方案 »
- 请帮忙做一下几个题目
- 关于两个edit完全相同的问题
- 怎么处理图片
- WORD控制问题
- 超难问题:如何使TComboBox和TBevel这种没有MouseDown事件的控件在被鼠标点中时有所相应?
- 如何把delphi的界面当作文件保存
- 请高手看看为什么这段代码为什么不能在delphi中正确执行
- 客户机没有安装SQL SEVER2000,如何显示装有SQL SEVER2000的机器名
- 第一次用ado
- 我用这个netmessagebuffersend怎么不好使,信使服务就是都不到,大家帮看看。
- ★送分帖,请 dabaicai、xianggang101、xiaokexinger三位朋友进入★
- ComBoBox中addObject函数的内存释放问题???
var
I: Integer;
FAppPath: String;
FFile, FNewFile: TFileName;
begin
// Allow Multi Select
OpenDialog1.Options := OpenDialog1.Options + [ofAllowMultiSelect];
if OpenDialog1.Execute then // Execute
begin
// Destine Path: Application Path
FAppPath := IncludeTrailingBackslash( ExtractFilePath(Application.ExeName) );
for I := 0 to OpenDialog1.Files.Count - 1 do // For each file
begin
FFile := OpenDialog1.Files[I]; // Get Filename
FNewFile := FAppPath + ExtractFileName(FFile); // Destrine FileName
if not CopyFile(PChar(FFile), PChar(FNewFile), True) then // Copy File
ShowMessageFmt('Copy File Failed: %s', [FFile]); // Show Message if Fail
end;
end;
end;
var
i:integer;
begin
OpenDialog1.Execute ;
for i:=0 to OpenDialog1.Files.Count-1 do
ListBox1.Items.Append(OpenDialog1.Files[i]);
end;