procedure TForm1.moveClick(Sender: TObject);<br>//移动c:/sybase目录下所有文件到d:/sybase目录下<br>var<br> sourcefile,destinationfile:STRING;<br> lpfileop:TSHFILEOPSTRUCT;<br>begin<br> sourcefile:= 'c:/sybase/*.*'+#0#0;<br> destinationfile:= 'd:/sybase'+#0#0;<br> fillchar(lpfileop,sizeof(lpfileop),0);<br> with lpfileop do<br> begin<br> wnd:=form1.handle;<br> wFunc:=FO_MOVE;<br> pFrom:=pchar(sourcefile);<br> pTo:=pchar(destinationfile);<br> fflags:= FOF_NOCONFIRMATION or FOF_NOCONFIRMMKDIR;<br> end;<br> if SHFileOperation(lpfileop)<>NOERROR then<br> if lpfileop. FAnyOperationsAborted then<br> showmessage('移动文件被终止') <br> else<br> showmessage('移动文件出错');<br> <br>end;<br>