How to Get All Drives Using VB.NET

In this article I describe how to get all drives in VB.NET.
  • 2312

Get all drives in VB.NET

The GetLogicalDrives method returns all the logical drives on a system.

Imports System.IO

Module Module1

    Sub Main()

        Dim drives As String() = System.IO.Directory.GetLogicalDrives()

        For Each drive As String In drives

            System.Console.WriteLine(drive)

        Next

        Console.ReadLine()

    End Sub

End Module

 

Output:


get all drives.jpg


Categories

More Articles

© 2018 DotNetHeaven. All rights reserved.