Y
ynduanlian
Unregistered / Unconfirmed
GUEST, unregistred user!
用下面的代码将ShellListview中选中的文件删除到回收站: if ShellListView1.SelCount>0 then begin ShowMessage(ShellListview1.SelectedFolder.PathName); P:=ShellListView1.SelectedFolder.PathName; if not FileExists(P) then exit; FillChar(T,sizeof(T),0); With T do Begin Wnd:=0; wFunc:=FO_DELETE; pFrom:=Pchar(P); fFlags:=FOF_ALLOWUNDO End; SHFileOperation(T); ShellListView1.Refresh; end;结果:当ShellListview1.SelectedFolder.PathName为下面这个时:D:/Documents/Studio/DataManagement/资料库/000_2.sql---------------------------删除文件或文件夹时出错---------------------------无法删除 文件: 无法读源文件或磁盘。---------------------------但是如果我用ShellListView的右键菜单随变将选中文件改下名字,比如加个0,就可以删除了,真是奇怪D:/Documents/Studio/DataManagement/资料库/0000_2.sql但把文件名改回去,就又不能删除了,这是怎么回事?