How do I get the name of a folder's parent folder

  • Thread starter Thread starter moondaddy
  • Start date Start date
M

moondaddy

How do you get the name of a folder's parent folder? Here's how I get the
folder name who I want to get it's parent's name:
Dim ClientPath As String = Directory.GetCurrentDirectory

thanks.
 
DirectoryInfo.Parent()

You can create an instance of DirectoryInfo passing the path to its
constructor.

--

Carlos J. Quintero

MZ-Tools 4.0: Productivity add-ins for Visual Studio .NET
You can code, design and document much faster.
http://www.mztools.com
 
moondaddy said:
How do you get the name of a folder's parent folder?

\\\
Imports System.IO
..
..
..
Dim d As New DirectoryInfo("C:\WINDOWS\SYSTEM32")
MsgBox(d.Parent.FullName)
///
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top