'在pic文件夹下有若干个名为Sc***.Dps的文件,要将这些文件读入数组处理,得不到文件名,请帮忙看看
我分不高,解决后全送了Dim FileName As String
Dim strFile() As String
Dim n As long,i As LongFilePath = App.Path & "\Pic\"
FileName = Dir(FilePath & "Sc*.Dps")n = o
If FileName <> "" Then
Do
DoEvents
n = n + 1
FileName = Dir()
Loop Until FileName = ""
End IfList1.Clear
Text1.Text = n '显示文件数(可以正常显示)ReDim strFile(1 To n) As String
For i = 1 To n
strFile(i) = FileName '问题应该是出在这儿
i = i + 1
List1.AddItem strFile(i)NextEnd Sub
我分不高,解决后全送了Dim FileName As String
Dim strFile() As String
Dim n As long,i As LongFilePath = App.Path & "\Pic\"
FileName = Dir(FilePath & "Sc*.Dps")n = o
If FileName <> "" Then
Do
DoEvents
n = n + 1
FileName = Dir()
Loop Until FileName = ""
End IfList1.Clear
Text1.Text = n '显示文件数(可以正常显示)ReDim strFile(1 To n) As String
For i = 1 To n
strFile(i) = FileName '问题应该是出在这儿
i = i + 1
List1.AddItem strFile(i)NextEnd Sub
解决方案 »
- 请问如何通过动态得到的表示属性名称的字符串来存取属性值
- 在VB6开发环境中按 F5(执行)和按 Ctrl+F5(全编译执行)的区别在哪里?
- 画线的问题
- 访问access数据库时候的问题(多帮忙)
- 大哥们,chr(0)代表什么啊?忘了
- 谁知道outlook和友情强档左边的能拉上拉下的菜单怎么做的
- 怎么样实现本地文件搜索功能!
- 我中了蠕虫病毒,用金山毒霸2002试用版杀了几次都杀不干净
- 如何让程序在windows登陆框之前自动运行?
- 请问存蓄过程代码怎么写?
- 请问如何用VB将注册表里的DWORD值转换成能看懂的文字串?
- 为什么网上流传的"用VB编写ActiveX DLL实现ASP编程"的实例总是"Microsoft VBScript 编译器错误 错误 '800a0408' 无效字符 set testme=server.createobject("first.test")
Dim FileName As String
Dim filepath As String
Dim strFile() As String
Dim n As Long
Dim i As Long
filepath = App.Path & "\Pic\"
FileName = Dir(filepath & "Sc*.Dps")
n = 0
While FileName <> ""
DoEvents
n = n + 1
ReDim Preserve strFile(n)
strFile(n) = FileName
FileName = Dir()
Wend
List1.Clear
Text1.Text = n
For i = 1 To n
List1.AddItem strFile(i)
Next
End Sub