上一页 1 2 3 4 5 6 返回选中的目录
.ulFlags = BIF_RETURNONLYFSDIRS End With | 调出浏览窗口
lpIDList = SHBrowseForFolder(udtBI) If lpIDList Then sPath = String$(MAX_PATH, 0) | 获取路径
| SHGetPathFromIDList lpIDList, sPath | 释放内存
CoTaskMemFree lpIDList iNull = InStr(sPath, vbNullChar) If iNull Then sPath = Left$(sPath, iNull - 1) End If End If
Screen.MousePointer = vbHourglass List1.Clear | SearchPath = sPath 选中的目录为搜索的起始路径 FindStr = "*.*" 搜索所有类型的文件(此处可另作定义) FileSize = FindFilesAPI(SearchPath, FindStr, NumFiles, NumDirs) Text1.Text = "查找到的文件数:" & NumFiles & vbCrLf & "查找的目录数:" & _ NumDirs + 1 & vbCrLf & "文件大小总共为:" & vbCrLf & _
Format(FileSize, "#,###,###,##0") & "字节" Screen.MousePointer = vbDefault End Sub | 上一页 1 2 3 4 5 6 |