How To Get Root Directory Using VB.NET

In this article I describe how to get root directory in VB.Net.
  • 3768

Get Root Directory in VB.NET

The GetRootDirecoty method returns the root directory of the specified directory.

Imports System.IO

Module Module1

    Sub Main()

        Dim root As String = "C:\Temp"

        Console.WriteLine(Directory.GetDirectoryRoot(root))

        Console.ReadLine()

    End Sub

End Module

 

Output:

 get root directory.jpg

Categories

More Articles

© 2019 DotNetHeaven. All rights reserved.