Option Explicit
Private Type SHFILEOPSTRUCT
hwnd As Long
wFunc As Long '对文件的操作指令
pFrom As String '源文件或路径
pTo As String '目的文件或路径
fFlags As Integer '操作标志
fAnyOperationsAborted As Long
hNameMappings As Long
lpszProgressTitle As String
End Type
Private Declare Function SHFileOperation Lib _
"shell32" _
(lpFileOp As SHFILEOPSTRUCT) As Long
Const FO_COPY = &H2
Const FO_DELETE = &H3
Const FO_MOVE = &H1
Const FO_RENAME = &H4
Const FOF_ALLOWUNDO = &H40
Const FOF_NOCONFIRMATION = &H10
Private Sub Command1_Click()'复制
Dim xFile As SHFILEOPSTRUCT
xFile.pFrom = Text1 + "\*.*" '源文件加
xFile.pTo = Text2 '目标文件夹
xFile.fFlags = FOF_NOCONFIRMATION
xFile.wFunc = FO_COPY
xFile.hwnd = Me.hwnd
If SHFileOperation(xFile) Then
End If
End Sub
上面是可以复制文件夹 然后就把原来的文件夹删了就可以
追问这个是不包含删除的代码对吧
追答dui ,删除OK的把?
追问其实也不会,但是我不需要此功能😊