DirectoryInfo.Delete deletes this instance of a DirectoryInfo, specifying whether to delete subdirectories and files. : DirectoryInfo « File Directory « VB.Net
DirectoryInfo.Delete deletes this instance of a DirectoryInfo, specifying whether to delete subdirectories and files.
Imports System
Imports System.IO
Public Class DeleteTest
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")
dis.Delete(True)
di.Delete(True)
End Sub 'Main
End Class 'DeleteTest