Private Const FO_MOVE = &H1 '删除文件夹
Public Function KillPath(ByVal sPath As String) As Boolean
On Error Resume Next Dim udtPath As SHFILEOPSTRUCT udtPath.hwnd = 0 udtPath.wFunc = FO_DELETE udtPath.pFrom = sPath udtPath.pTo = "" udtPath.fFlags = FOF_NOCONFIRMATION Or FOF_SILENT Or FOF_NOERRORUI KillPath = Not CBool(SHFileOperation(udtPath)) End Function '复制文件夹 Public Function CopyPath(ByVal sPath As String, ByVal sTo As String) As Boolean
On Error Resume Next Dim udtPath As SHFILEOPSTRUCT udtPath.hwnd = 0 udtPath.wFunc = FO_COPY udtPath.pFrom = sPath udtPath.pTo = sTo udtPath.fFlags = FOF_NOCONFIRMATION Or FOF_SILENT Or FOF_NOERRORUI CopyPath = Not CBool(SHFileOperation(udtPath)) End Function Private Sub Command1_Click() |
|