比如a盘有一些文件 ,现在在编辑框中输入某一文件的名字,按‘确定’按扭,就把该文件从a盘复制到c盘,用什么命令?谢谢
我用下面这个语句,但是文件名只能是file.txt啊!55555555555
CopyFile('a:\file.txt','c:\file.txt', True);
我用下面这个语句,但是文件名只能是file.txt啊!55555555555
CopyFile('a:\file.txt','c:\file.txt', True);
解决方案 »
- idtcpserver的最大连接数问题.
- 发现Access数据库的Bug,高手帮助
- 如何修改com程序里的clsid?
- 如何让SQL中的nvarchar类型在delphi的table+dbgrid中显示,如能解决给分50!
- 关于操作word的巨难问题,高手高高手请进,俺再送50分
- 請教大家!這個存儲過程該怎麼寫?
- 用SetWindowLong() 在 treeview上加载checkbox后如何取值???
- 有没有可以显示主从表在同一个grid中的控件呢?
- 如何实现表格行列拖动,换肤功能?
- 如何在点击属性STYLE=tbsDropDown的TOOLBUTTON时就下拉DROPDOWNMENU属性中指定的菜单项?
- ADO方式下,怎样在一个数据库里查找一个字段是否与edit1.text值相等?如何返回具体个数?
- 如何把一个数据库里的多个表转到另外一个数据库里,其中支持修改表名和字段名?(在线等)
网上的例子太多了
const Destination: stringDestination file name.
ReturnsBoolean - True if the file is copied, False on error.
DescriptionCopyFileTo is a function used to copy the file specified in Source to the file specified in Destination.
CopyFileTo will return False if the file in Destination already exists.
CopyFileTo encapsulates the platform-specific calls needed to perform the file copy operation. On the Windows platform, this is the Win32 API function CopyFile. On the Linux platform, CopyFileTo uses a TFileStream instance to create the destination file.
uses ShellApi;
{ 利用ShellApi中: function SHFileOperation(const lpFileOp: TSHFileOpStruct): Integer; stdcall; }
Var T:TSHFileOpStruct;
P:String;
begin
P:='C:\Windows\System\EL_CONTROL.CPL';
With T do
Begin
Wnd:=0;
wFunc:=FO_copy;
pFrom:=Pchar(P);
fFlags:=FOF_ALLOWUNDO
End;
SHFileOperation(T);
End.