Directory.GetParent : Directory « System.IO « VB.Net by API






Directory.GetParent

  


Imports System.IO

Module Module1

    Sub Main()
        Dim Current As String
        Dim Parent As DirectoryInfo

        Try
            Current = Directory.GetCurrentDirectory()
            Parent = Directory.GetParent(Current)

            Console.WriteLine("Current directory {0}", Current)
            Console.WriteLine("Parent directory {0}", Parent.FullName)
        Catch E As Exception
            Console.WriteLine("Error determining parent directory")
            Console.WriteLine(E.Message)
        End Try
    End Sub

End Module

   
    
  








Related examples in the same category

1.Directory.CreateDirectory
2.Directory.Delete
3.Directory.Exists
4.Directory.GetCurrentDirectory()
5.Directory.GetDirectoryRoot
6.Directory.GetFileSystemEntries
7.Directory.GetLogicalDrives()
8.Directory.Move
9.Directory.SetCurrentDirectory