四.程序的源代码(recycled.cs).编译方法及运行后的界面: (1).程序的源代码:recycled.cs: using System.IO ; using System.Windows.Forms ; //导入程序中用到的名称空间 class Recycle { public static void Main ( ) { int c = 0 ; // 定义此变量主要是来判断目录中是否有文件 foreach ( string s1 in Directory.GetFiles ( "c:\…
//在uses下面引用 function SHEmptyRecycleBinA(Wnd:HWND;str:PChar;WRD:DWORD):Integer;stdcall; external 'SHell32.dll'; {清空回收站} //调用 EmptyRecycle(); function EmptyRecycle():boolean; begin Result:=true; try if Application.MessageBox('确定要清空回收站吗?','提示'…
在Ubuntu17.04下,遇到清空回收站文件时报错,提示”Failed to delete the item from the trash”,无法清空回收站. 回收站其实就是一个文件夹,存放着被删掉的文件. Ubuntu回收站的路径: 解决方法 打开终端运行以下命令强制清空回收站目录下的所有文件: sudo rm -rf ~/.local/share/Trash/* 执行上面命令后,可以看到回收站所有文件已清空…