Mega Code Archive

 
Categories / VB.Net / File Directory
 

DirectoryInfo Root Property gets the root portion of a path

Imports System Imports System.IO Public Class MoveToTest     Public Shared Sub Main()         Dim di As New DirectoryInfo("TempDir")         If di.Exists = False Then             di.Create()         End If         Dim dis As DirectoryInfo = di.CreateSubdirectory("SubDir")         Console.WriteLine("The root path of '{0}' is '{1}'", dis.Name, dis.Root)         di.Delete(True)     End Sub  End Class