Groups | Blog | Home
all groups > vb.net > march 2005 >

vb.net : Navigating to the parent subdirectory


BobAchgill
3/17/2005 11:41:09 PM
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!

BobAchgill
3/18/2005 1:06:12 AM
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)

[quoted text, click to view]
Cor Ligthert
3/18/2005 9:06:08 AM
Bob,

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

Cor

Herfried K. Wagner [MVP]
3/18/2005 10:12:50 AM
"BobAchgill" <anonymous@discussions.microsoft.com> schrieb:
[quoted text, click to view]

\\\
Dim ParentDirectory As String = _
Directory.GetParent("C:\foo\goo").FullName
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
AddThis Social Bookmark Button