473,386 Members | 1,830 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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

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.

--
mo*******@nospam.com
Nov 21 '05 #1
3 11348
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" <mo*******@nospam.com> escribió en el mensaje
news:eV**************@TK2MSFTNGP14.phx.gbl...
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.

--
mo*******@nospam.com

Nov 21 '05 #2
"moondaddy" <mo*******@nospam.com> schrieb:
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)
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #3
Thanks. Looks like just what I need.

--
mo*******@nospam.com
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
"moondaddy" <mo*******@nospam.com> schrieb:
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) ///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Anushya | last post by:
Hi when i try to browse thru all the folders in outlook recursively starting from the root folder, i couldnot explore the USER FOLDERS which comes straight under root folder. Wot is the...
9
by: Paul | last post by:
I'm trying to make get my app to delete all the files in a specified folder and all the files within the folders of the specified folder. e.g. Folder 1 contains three files (File1, File2, File3)...
4
by: John Dann | last post by:
Is there any method in the File, Directory, FileInfo, Path etc classes that makes it easy to retrieve the folder name of the immediate parent folder of a file? I can't see one, but maybe I've...
4
by: raj_genius | last post by:
I hav two queries, whc are as follows: FIRSTLY: is it possible to access the controls(by name) of a parent form(MDI) from its child forms??if yes then how??plzz provide a coded example in VB if...
2
by: John Kotuby | last post by:
Hi all, I have a rather large classic ASP application that uses relative references like ...\common\connection.asp all over the place in about 60 pages. The application works OK on my XP Pro...
8
by: supasnail | last post by:
I have a happily working set of asp pages which read from the database via include file "./_private/include/database.mdb". However, when I try to gain access to this database on pages one folder...
1
by: sam | last post by:
OpenFileDialog appears to be "holding onto" the parent folder of a selected file until the application using the dialog quits. After creating a folder containing a file, I attempted to select...
0
by: sudhivns | last post by:
Hi, How to find the parent folder of a specfied file. Eg: File is C:\EX1000\Data\Temp\Unknown\readme.txt and want to know the parent root structure. SO output im string output like...
5
by: Sin Jeong-hun | last post by:
Hello. Speical folders, like Desktop, usually have different display names. For example, in Japanese Windows, it's displayed as "$B%G%9%/%H%C%W(B". I want to get the this displayed name of a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.