在C盘建立tyn1目录,里面放几个文件 :<br><br>procedure TForm1.Button1Click(Sender: TObject);<br>var<br> FileOpStruct :TSHFileOpStruct;<br> Buf1 :array [0..127] of Char;<br> Str1 :String;<br>begin<br> Str1 :='c:/tyn1';<br> FillChar(Buf1,SizeOf(Buf1),0);<br> StrPCopy(Buf1,Str1);<br> with FileOpStruct do<br> begin<br> Wnd :=Handle;<br> wFunc :=FO_DELETE;<br> pFrom :=@Buf1;<br> pTo :=nil;<br> fFlags :=FOF_SIMPLEPROGRESS;<br> fAnyOperationsAborted :=False;<br> hNameMappings :=nil;<br> lpszProgressTitle :='删除文件';<br> end;<br> SHFileOperation(FileOpStruct);<br>end;<br>记得添加ShellAPI单元!