我文件夹下有4000多个.htm文件. 它给我枚举到999个就为止了. 1000后面的全丢下不管了.
我目的是用来读取这些htm文件正则取里面的字符.
有什么方法让它一次性全部遍历枚举完吗? 谢谢!strfile = Dir(App.Path & "\*.htm")
Do Until strfile = ""Open strfile For Input As #7
While Not EOF(7) 'EOF为文尾测试函数
Line Input #7, s '读入并放在临时字串中
Wend
Close #7
.... strfile = Dir
LoopMsgBox "完毕"
我目的是用来读取这些htm文件正则取里面的字符.
有什么方法让它一次性全部遍历枚举完吗? 谢谢!strfile = Dir(App.Path & "\*.htm")
Do Until strfile = ""Open strfile For Input As #7
While Not EOF(7) 'EOF为文尾测试函数
Line Input #7, s '读入并放在临时字串中
Wend
Close #7
.... strfile = Dir
LoopMsgBox "完毕"
strfile = Dir(App.Path & "\*.htm")
Do Until strfile = ""'Open strfile For Input As #7
'While Not EOF(7) 'EOF为文尾测试函数
' Line Input #7, s '读入并放在临时字串中
'Wend
'Close #7
'....
Debug.Print strfile
strfile = Dir
LoopMsgBox "完毕"
'BY 嗷嗷叫的老马
'紫水晶工作室
'http://www.m5home.com/
Dim I() As String, J As Long<I = SearchFileInPath("c:\windows\web", "*.*")
For J = 0 To UBound(I)
Debug.Print I(J) '打印所有文件
Next