Directory.GetCurrentDirectory()
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