How to get all the files from a directory in windows with VB.NET

1 Answer

0 votes
Imports System.IO

Module Module1

    Sub Main()

        Dim dir As String = "d:\source\_working_frame\"

        Dim files() As String = Directory.GetFiles(dir)

        For Each element As String In files
            Console.WriteLine(element)
        Next

    End Sub

End Module


' run:
' 
' d:\source\_working_frame\output.txt
' d:\source\_working_frame\sqlite3.dll
' d:\source\_working_frame\wf.exe
' d:\source\_working_frame\wf.ico
' d:\source\_working_frame\wf.lpi
' d:\source\_working_frame\wf_main.compiled
' d:\source\_working_frame\wf_main.lfm
' d:\source\_working_frame\wf_main.pas
' d:\source\_working_frame\workingframe.sqlite
' ...

 



answered Oct 18, 2018 by avibootz
...