use SHFileOperation API
http://www.allapi.net/apilist/SHFileOperation.shtmlHow to Copy or Move an Entire Directory using the API
http://www.mvps.org/vbnet/index.html?code/shell/shfileopadv.htmUtilizing Windows SHFileOperation API, Advanced
http://www.mvps.org/vbnet/index.html?code/shell/shfileopadv.htm
http://www.allapi.net/apilist/SHFileOperation.shtmlHow to Copy or Move an Entire Directory using the API
http://www.mvps.org/vbnet/index.html?code/shell/shfileopadv.htmUtilizing Windows SHFileOperation API, Advanced
http://www.mvps.org/vbnet/index.html?code/shell/shfileopadv.htm
解决方案 »
- vb怎么编写通过IP查服务器绑定多少个域名
- 急急急,关于窗体的两个问题,在线等,请知道下菜鸟,解决立刻给分
- 在VB中如何编写串口通讯程序的问题
- winsock怎样判断客户端已经失去连接?急
- VB中socket编程时采用占用内存不断增加的问题!!
- 如何将n个变量或对象传递给定义的ScriptControl实例对象(程序与脚本的通讯),求助高手!
- 如何将货币的数值显示再文本框?
- 送分了!access2003中sql访问得奇怪现象
- 请问那里可以下载VB6
- 如何设置使textbox的输入只接收数字(或有类似textbox的控件)谢谢!!
- 我有一个拼音汉字表,如何实现:输入汉字(多个),自动写出头拼码?
- 怎么样可以得到文件列表框内的文件名呢?
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.dll" Alias "SHFileOperationA" (lpFileOp As SHFILEOPSTRUCT) As Long
Private Const FO_MOVE = &H1
Private Const FO_COPY = &H2
Private Const FO_DELETE = &H3
Private Const FO_RENAME = &H4
Private Const FOF_ALLOWUNDO = &H40
Private Const FOF_SIMPLEPROGRESS = &H100
Private Function CopyFileX(Filename() As String, BeginPath As String, ToPath As String) As Boolean
Dim tmpInt As Integer
Dim tpFile As SHFILEOPSTRUCT
Dim tmpStr As String
Dim rc As Long
tmpStr = BeginPath & Filename(0)// Finename(0)放路径,剩下的放文件名
For tmpInt = 1 To UBound(Filename)
tmpStr = tmpStr & Chr(0) & BeginPath & Filename(tmpInt)
Next
With tpFile
.wFunc = FO_Copy
.pFrom = tmpStr
.pTo = ToPath & Chr(0) & Chr(0)
End With
rc = SHFileOperation(tpFile)
end function
attribut.nLength = Len(attribut)
attribut.lpSecurityDescriptor = &O0
attribut.bInheritHandle = False
Dim counter As Long
Dim tnew As String
Dim onew As String
Dim i As Long
Dim lnew As Long
Dim tx As String
Dim mi As String
Dim minstra As Long
Dim a As String
a = InputBox("请输入要创建的文件夹名", "创建文件夹名")
counter = 0
If Right(a, 1) <> "\" Then
a = a & "\"
End If
lnew = Len(a)
For i = 1 To lnew
tx = Left(a, i)
If Len(tx) > 3 Then
mi = Right(tx, 1)
If mi = "\" Then
Call CreateDirectory(tx, attribut)
End If
End If
Next iend sub