首页上一页 1 下一页尾页 3 条记录 1/1页
求助!
发表在VB答疑区
2011-04-14
是否精华
是
否
版块置顶:
是
否
Dim w As String
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub
Private Sub Dir1_Change()
List1.Clear
sosuofile (Dir1.List(Dir1.ListIndex))
End Sub
Sub sosuofile(MyPath As String)
Dim Myname As String
Dim dir_i() As String
Dim u, idir As Long
If Right(MyPath, 1) <> "\" Then MyPath = MyPath + "\"
Myname = Dir(MyPath & "\*.DAT")
Do While Myname <> ""
If Myname <> "." And Myname <> ".." Then
If (GetAttr(MyPath & Myname) And vbDirectory) = vbDirectory Then
idir = idir + 1
ReDim Preserve dir_i(idir) As String
dir_i(idir - 1) = Myname
Else
w = "" & MyPath & "" & Myname
End If
End If
Myname = Dir
Loop
For u = 0 To idir - 1
Call sosuofile(MyPath + dir_i(u))
Next u
End Sub
Private Sub Command1_Click()
Open w For Binary As #1
Text1.Text = Input(LOF(1), 1)
Close #1
End Sub
如何同时打开w里面的所有路径并把所有文件的内容显示在Text1.Text里。
在这里先谢谢各位了。
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub
Private Sub Dir1_Change()
List1.Clear
sosuofile (Dir1.List(Dir1.ListIndex))
End Sub
Sub sosuofile(MyPath As String)
Dim Myname As String
Dim dir_i() As String
Dim u, idir As Long
If Right(MyPath, 1) <> "\" Then MyPath = MyPath + "\"
Myname = Dir(MyPath & "\*.DAT")
Do While Myname <> ""
If Myname <> "." And Myname <> ".." Then
If (GetAttr(MyPath & Myname) And vbDirectory) = vbDirectory Then
idir = idir + 1
ReDim Preserve dir_i(idir) As String
dir_i(idir - 1) = Myname
Else
w = "" & MyPath & "" & Myname
End If
End If
Myname = Dir
Loop
For u = 0 To idir - 1
Call sosuofile(MyPath + dir_i(u))
Next u
End Sub
Private Sub Command1_Click()
Open w For Binary As #1
Text1.Text = Input(LOF(1), 1)
Close #1
End Sub
如何同时打开w里面的所有路径并把所有文件的内容显示在Text1.Text里。
在这里先谢谢各位了。