怎么没人回复,DIR函数参数设置,文件输入输出的函数调用.

解决方案 »

  1.   

    Dim strPath As String, strFile As String, strFileName As String
    Dim strNew As String, strTmp As String, lngF As LongstrPaht = "c:\docDir"
    strNew = "c:\New"
    strTmp = "C:\txtIndex.txt"strFile = Dir(strPaht & "\*.txt")
    If strFile <> "" Then
       strFileName = strFileName & strFile & vbCrLf
       Do Until strFile = ""
          strFile = Dir
          If strFile <> "" Then strFileName = strFileName & strFile & vbCrLf
       Loop
       lngF = FreeFile
       Open strTmp For Output As lngF
            Print #lngF, strFileName
       Close #lngF
    End If
      

  2.   

    找一个file控件,后缀写死为"*.txt",他就可自动找出来了