use ShellAPI;<br><br>procedure TForm1.DeleteFileToRecycled(const AFile: String);<br>var<br> OpStruc: TSHFileOpStruct;<br>begin<br> with OpStruc do<br> begin<br> Wnd := 0;<br> wFunc := FO_DELETE;<br> pFrom := Pchar(AFile);<br> //0:直接删除 FOF_ALLOWUNDO:删除文件到回收站<br> fFlags := 0;//FOF_ALLOWUNDO;<br> end;<br> SHFileOperation(OpStruc);<br>end;