any function for listing out all the files of a specified type in a folder in VB6

前端 未结 6 1676
无人及你
无人及你 2020-12-04 03:36

I would like to know if there are some in built functions for the scenario that is described below :

The input is the path of a parent folder. Wat the function must

6条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-04 03:37

    Using VB.NET you can do this with System.IO.Directory.GetFiles. There is a version that takes a pattern to search for and let's you search subdirectories as well.

    For Each dir In Directory.GetFiles("path","*.zip",SearchOptions.AllDirectories)
        Console.WriteLine( _
            "{0,-25} {1,25}", dir.FullName, dir.LastWriteTime)
    Next dir
    

提交回复
热议问题