rt

解决方案 »

  1.   


    Dim fso As New FileSystemObject
    fso.DeleteFile "c:\cc\*.txt"
      

  2.   

    Sub ShowFolderList(folderspec)
        Dim fs, f, f1, fc, s
        Set fs = CreateObject("Scripting.FileSystemObject")
        Set f = fs.GetFolder(folderspec)
        Set fc = f.Files
        For Each f1 In fc
            If UCase(Right(f1.Name, 3)) = "TXT" Then
             s.Delete
           End If
        Next
    End Sub
      

  3.   

    用filelistbox
    Private Sub Command1_Click()
    On Error Resume NextFile1.Pattern = "*.txt"
    File1.Path = "C:\1"For i = 0 To File1.ListCount - 1Kill File1.Path + "\" + File1.List(i)NextEnd Sub