Quantcast
Channel: .Net Core | MVC | HTML Agility Pack | SQL | Technology Crowds
Viewing all articles
Browse latest Browse all 544

List all directories and sub-directories

$
0
0

Try Like This:
Below is code snippet how to list all directories & sub-directories in vb.net (ASP.net)

imports system.IO namespace

        Dim filepath As String = String.Empty
        If (Directory.Exists("c:\")) Then
            Dim drInfo As DirectoryInfo = New DirectoryInfo(folderpath)
            Dim files() As FileInfo = drInfo.GetFiles("*.opf")
            If (files.Length > 0) Then
                filepath = files(0).FullName
            End If
        End If

Viewing all articles
Browse latest Browse all 544

Trending Articles