Navigating to the parent subdirectory

  • Thread starter Thread starter BobAchgill
  • Start date Start date
B

BobAchgill

Is this the right way to get to back up to the immediate
parent subdirectory?

Directory.GetParent("\")

or this?

Directory.GetParent("..")

Or this?

Directory.GetParent()

Thanks!

Bob
 
Bob,

What is the reason that you just don't try this kind of things yourself.

Cor
 
Cor,

Thanks for the encouragement to persist...

Once I figured out I could put TextBox1's on either side
of the line of code I was trying to change to the parent
directory then I could start to see what was going on in
the Auto window.

And the winning line of code to change to a parent
directory iiiisssssss.....

TextBox1.Text = Directory.GetCurrentDirectory()

Directory.SetCurrentDirectory(Directory.GetParent(CurDir
()).ToString)

TextBox1.Text = Directory.GetCurrentDirectory()

Thanks!

Bob

Teach a man to fish and he will not go hungry...
Give a man a fish and he will starve to death.

This one needed some persisting on my part. :o)
 
BobAchgill said:
Is this the right way to get to back up to the immediate
parent subdirectory?

\\\
Dim ParentDirectory As String = _
Directory.GetParent("C:\foo\goo").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