VB中删除文件夹

来源:百度知道 编辑:UC知道 时间:2024/05/20 06:10:29
文件夹中含有上百个文件,不可能逐一删除的。而且不和程序在同一目录中。高手帮忙!

兄台.你复制下面的代码,试试
如果成功的话.能否给个5 分 10分给我,呵呵 开玩笑啦

'VB强行删除目录或(VB强行删除文件)模块源码
'需要控件:command1
Public Enum FO_Operation
FO_MOVE = 1
FO_COPY = 2
FO_DELETE = 3
FO_RENAME = 4
End Enum

Public Enum FOFlags
FOF_MULTIDESTFILES = &H1 'Destination specifies multiple files
FOF_SILENT = &H4 'Don't display progress dialog
FOF_RENAMEONCOLLISION = &H8 'Rename if destination already exists
FOF_NOCONFIRMATION = &H10 'Don't prompt user
FOF_WANTMAPPINGHANDLE = &H20 'Fill in hNameMappings member
FOF_ALLOWUNDO = &H40 'Store undo information if possible
FOF_FILESONLY = &H80 'On *.*, don't copy directories
FOF_SIMPLEPROGRESS = &H100 'Don't show name of each file
FOF_NOCONFIRMMKDIR = &H200 'Don't confirm making any needed dirs
End Enum

Public Type SHFILEOPSTRUCT
hwnd As Long
wFunc As Long
pFrom As String
pTo As S