急寻关于VB

来源:百度知道 编辑:UC知道 时间:2024/05/26 07:25:22
我想用VB做一个文件搜索系统,通过输入关键字、包含字符、选择路径查找文件,在一个文本框中显示匹配文件名和路径,部分代码如下:
Private Declare Function BrowseForFolder Lib "shell32.dll" Alias "BrowseForFolderA" (lpBrowseForFolder As BROWSEINFO) As Long

Private Sub cmdFolder_Click()
On Error Resume Next
Dim sTmp As String
sTmp = IIf(Len(Dir(txtFolder.Text, vbDirectory)) > 0, txtFolder.Text, "") 'If the text in the Folder text box is not a directory, we cannot use it as the start up for the Folder Open API or it will crash.
sTmp = BrowseForFolder(sTmp, "选择搜索路径...") 'Show the Open Folder dialog.
If Len(sTmp) > 0 Then txtFolder.Text = sTmp
End Sub
Private Sub cmdSearch_Click()
Dim sTmp() As String
Dim sSearchPaths() As String
Dim X As Integer
Dim sPaths As String
Select Case cmdSearch.Caption 'Easy m

晕,看的眼花,劝你直接取vb站下载源码程序,这样至少可以直接运行了,然后在根据自己的需要更改。
是在是不喜欢看别人写的代码,眼花不说,单单是控件和变量的命名就够让我晕的了-_-
因为根本不符合个人的习惯,而且有的程序变量控件又暴多…………………………
你学api了吗??
BrowseForFolderA 是什么作用的api?我的vb里里面找不到。还是去 下载专门的源码把
网站推荐
枕善居,百度vb贴吧
绝对能够找到的特别是枕善居,里面都是能够下载回来之后能够在vb中直接运行的!!