copyfile(source,dest,overwrite)overwrite参数true:是覆盖
false:是不覆盖可是我用的结果是恰恰相反,false为覆盖,true不覆盖,大家又用过的吗?
false:是不覆盖可是我用的结果是恰恰相反,false为覆盖,true不覆盖,大家又用过的吗?
解决方案 »
- 求教指针转换
- D7调用TLB文件中的以下过程改如何处理
- 我现在想在程序里修改.dbf数据库表里的字段的(名称和)属性,
- 大家帮我解决这个问题!
- 有没有人看过邮电出版社的《delphi6数据库系统开发实例导航》,评价一下
- 我要在OCX里包含一个MDI的多文档应用,通过网页浏览运行,哪位大侠有办法,请指点
- 请问一个在listview中的右击菜单问题,谢谢!
- 怎样获得一个页面内的所有链接
- 请教一个计算字段的出错问题,错在哪里?20分
- delphi初学者问题,TDateTimePicker能否实现只有年月,没有日期?如何才能实现?
- 求教ORACLE数据库分布系统
- 请问数据库中字段是image,如果没有保存图片,显示会出错,请问如何判断是否存在图片?
procedure TForm1.FileCopy(const SourceFileName, TargetFileName: string);
var
S, T: TFileStream;
begin
S := TFileStream.Create(SourceFileName, fmOpenRead);
try
T := TFileStream.Create(TargetFileName, fmOpenWrite or fmCreate);
try
T.CopyFrom(S, S.Size);
finally
T.Free
end;
finally
S.Free;
end;
end;
The CopyFile function copies an existing file to a new file. BOOL CopyFile( LPCTSTR lpExistingFileName, // pointer to name of an existing file
LPCTSTR lpNewFileName, // pointer to filename to copy to
BOOL bFailIfExists // flag for operation if file exists
);
ParameterslpExistingFileNamePoints to a null-terminated string that specifies the name of an existing file. lpNewFileNamePoints to a null-terminated string that specifies the name of the new file. bFailIfExistsSpecifies how this operation is to proceed if a file of the same name as that specified by lpNewFileName already exists. If this parameter is TRUE and the new file already exists, the function fails. If this parameter is FALSE and the new file already exists, the function overwrites the existing file and succeeds.
LPCTSTR lpNewFileName, // pointer to filename to copy to
BOOL bFailIfExists // flag for operation if file exists
);
bFailIfExists 为true说明如果文件存在的话,就拷贝失败
为false说明如果文件已经存在的话,也不返回copy失败的信息
金山词霸查得:overwrite覆盖。
呵呵,函数里面有介绍的哦,你看下delphi帮助文档哦!