Private Sub Dir1_Change()
File1.Path = Dir1.Path
Label1.Caption = Dir1.Path
End Sub
Private Sub Drive1_Change()
On Error GoTo err1
Dir1.Path = Drive1.Drive
Exit Sub
err1:
MsgBox Err.Description, vbInformation + vbOKOnly, "提示"
End Sub
Private Sub Command1_Click()
Dim i As Integer, j As Integer
Dim ifieldcount As Integer, irecordcount As Integer
Dim wdapp As Word.Application
Dim wddoc As Word.Document
Dim atable As Word.Table
If Option2.Value = True Then
ReDim a(1 To File1.ListCount)
For i = 1 To File1.ListCount
b = File1.List(i)
a(i) = b
Next
End If
If Option1.Value = True Then
ReDim a(1 To Dir1.ListCount)
For i = 1 To Dir1.ListCount
b = Dir1.List(i)
a(i) = b
Next
End If
End Sub
这段程序 复制过去 就行了 创建的控件有 两个option 让你选择 要提取文件夹 还是文件歼好路径的 选中option 1 就是提取文件夹的 option2 就是提取文件的 然后再创建 Drive1 Dir1 File1 这三个亮改消 选择文件路径的 控件 再加一个 command 按钮 就行了 有疑问再联系我!!!!敬知!这个 只是 文件路径 你看看 是你想要的话 我再给你写 提取文件夹和文件名的代码!!!!
1、首先,在电脑上打开VB6.0属性窗口,新建一个EXE工程窗口。
2、然后,就能在这里看到帮组文件名一栏。这时,就能在这里按下这个三点进行选择文件。
3、接下来就可以这个帮组文件的窗口。
4、此时,就能在这里进行帮组文件的晌氏加载。
5、最后,点宴弊散击打开按钮既可打开卜拿VB的帮助文件。
有两种方法:1、使用DIR递归,不过这是微软明确不推荐的
2、最快但不太正规的
使贺漏用 Shell "cmd /k dir c:\windows /s/b/卖尘a >>d:\jg.txt"
c:\windows 目标文件夹,当前文件夹为 app.path,你可以根据要求生成命令字符串
d:\jg.txt 为临时文件
执行这行后再读取临时文件禅配烂即可。极快!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)