请问如何删除一个目录及其内部所有内容(100分)

  • 主题发起人 主题发起人 dinny
  • 开始时间 开始时间
D

dinny

Unregistered / Unconfirmed
GUEST, unregistred user!
如果用TShFileOpStruct,能不能不出现确认放到回收站的对话框?
 
TShFileOpStruct有一个参数,就不会出现对话框了:<br>TShFileOpStruct.fFlags := FOF_ALLOWUNDO //不删除到回收站与否<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;OR FOF_NOCONFIRMATION //不提示是否删除<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;OR FOF_SILENT//不出现提示窗口.<br>看看它的帮助吧!<br>
 
TShFileOpStruct的帮助那里有呢?<br><br>DELPHI里有没有强制删除整个目录的函数呢?
 
function DelDirectory(const Source:string): boolean;<br>var<br>&nbsp; fo: TSHFILEOPSTRUCT;<br>begin<br>&nbsp; FillChar(fo, SizeOf(fo), 0);<br>&nbsp; with fo do<br>&nbsp; begin<br>&nbsp; &nbsp; Wnd := 0;<br>&nbsp; &nbsp; wFunc := FO_DELETE;<br>&nbsp; &nbsp; pFrom := PChar(source+#0);<br>&nbsp; &nbsp; pTo := #0#0;<br>&nbsp; &nbsp; fFlags := FOF_NOCONFIRMATION+FOF_SILENT;<br>&nbsp; end;<br>&nbsp; Result := (SHFileOperation(fo) = 0);<br>end;<br>
 
TShFileOpStruct的帮助:<br>开始-&gt;程序-&gt;Borland Delphi 5-&gt;Help-&gt;<br>MS SDK Help Files-&gt;Win32 Programmer's Reference-&gt;<br>在“索引”里输入“SHFILEOPSTRUCT”-&gt;单击“显示”-&gt;看!
 
多人接受答案了。
 
后退
顶部