深圳升蓝软件
数据库开发 .Net技术  |  ASP技术 PHP技术 JSP技术 应用技术类   
Hiblue Software

读取目录下的文件得到一个数组


March 25,2004
filename=dir("盘符:*.*")
i = 0
do while filename = ""
array1 (i)=filename
i = i + 1
filename = dir("c:*.*")
loop
VB好象也有比较好的方法,但是我不太清楚了
VBScript
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder("盘符:")
Set fc = f.Files
i = 0
For Each f1 in fc
array1(i)=f1.name
i=i+1
Next
  
资料来源:碧波山庄Visual Basic http://ctsvb.126.com
Copyright © 2001-2008 Shenzhen Hiblue Software Team All rights reserved