要求首先选取一个文件夹,然后依次读文件夹下面的每个文件,该怎么做?我用的是Open "c:\test\a.txt" For Random As #1 Len = Len(c)来读一个确定的文件,主要是依次确定每个文件名不知道该怎么做.分不多了,大家帮帮我啊

解决方案 »

  1.   

    基本思路是! dir控件 + file控件 dir 控件指定目标文件夹 >> file控件显示目标文件夹里的内容 !循环 file控件的项目 就是你想要的了!for i = 0 to file.listcount-1open...
    ...
    close #若想打开的全部是txt 或其他类型的文件 可以设置file控件 让其只显示自己需要类型的文件 便可以了!
      

  2.   

    dim s as string
    dim sFullPath as string s = dir("c:\test\*.txt")
    while lenb(s) <> 0
        if (s<>".") and (s <> "..") then
            sFullPath = "c:\test\" & s
            if (getattr(sfullpath) and vbdirectory) <> vbdirectory then
                '读取文件 sFullPath
                ...
            end if
        end if
        s = dir()
    wend