Get Files in a Directory Using VB.NET

In this article I describe how to get files in a directory in VB.Net.
  • 6536

Get Files in a Directory

The GetFiles method gets a list of files in the specified directory.

Imports System.IO

Module Module1

    Sub Main()

        Dim root As String = "C:\Temp"

        Dim fileEntries As String() = Directory.GetFiles(root)

        For Each fileName As String In fileEntries

            Console.WriteLine(fileName)

        Next

        Console.ReadLine()

    End Sub

End Module
 

Output:


 get file list in vb.jpg


 

Categories

More Articles

© 2013 dotNetheaven. All rights reserved.