468,554 Members | 1,972 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,554 developers. It's quick & easy.

how can I get just directory names?

I can get file names with the following code...

Dim di As New DirectoryInfo("c:\OrderData\Database")
Dim fiArr As FileInfo() = di.GetFiles()
Dim f As FileInfo

For Each f In fiArr
Dim fileword As String = (f.Name)
sfw1a.WriteLine(fileword)
txtFileText.Text = (fileword)
Next f
How can I get just directory names in one folder?
thanks,
Trint

.Net programmer
tr********@hotmail.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #1
1 4983
Trint,
Have you tried DirectoryInfo.GetDirectories?
Dim fiArr As FileInfo() = di.GetFiles()
Dim dirs() As DirectoryInfo = di.GetDirectories()

Hope this helps
Jay

"Trint Smith" <tr********@hotmail.com> wrote in message
news:Ox**************@tk2msftngp13.phx.gbl... I can get file names with the following code...

Dim di As New DirectoryInfo("c:\OrderData\Database")
Dim fiArr As FileInfo() = di.GetFiles()
Dim f As FileInfo

For Each f In fiArr
Dim fileword As String = (f.Name)
sfw1a.WriteLine(fileword)
txtFileText.Text = (fileword)
Next f
How can I get just directory names in one folder?
thanks,
Trint

Net programmer
tr********@hotmail.com

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Jim Dabell | last post: by
2 posts views Thread by NeverLift | last post: by
2 posts views Thread by Steven J. Reed | last post: by
5 posts views Thread by Martin Carpella | last post: by
1 post views Thread by UniDue | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.