VB/Script 怎样读取一个目录下的所有文件名到数组? VB用dir,VBScript用files
|
|
|
作者:佚名
来源:InterNet 加入时间:2005-4-4 |
Example: VB filename=dir("c:\*.*") 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("c:\") Set fc = f.Files i = 0 For Each f1 in fc array1(i)=f1.name i=i+1 Next
[文章录入员:nancy] |
|
|
|
|