PC Review


Reply
Thread Tools Rate Thread

how can I get just directory names?

 
 
Trint Smith
Guest
Posts: n/a
 
      3rd Oct 2003
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
(E-Mail Removed)

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
 
Jay B. Harlow [MVP - Outlook]
Guest
Posts: n/a
 
      3rd Oct 2003
Trint,
Have you tried DirectoryInfo.GetDirectories?

> Dim fiArr As FileInfo() = di.GetFiles()


Dim dirs() As DirectoryInfo = di.GetDirectories()

Hope this helps
Jay

"Trint Smith" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
> (E-Mail Removed)
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help to copy files names in a column from one directory to another directory VBA Paul B Microsoft Excel Programming 4 10th Nov 2008 01:54 AM
Help: copying directory share names whilst doing bulk directory/file duplication. Troy Microsoft Windows 2000 1 4th May 2005 11:15 AM
Creating a macro that lists directory names within a directory.... =?Utf-8?B?QW5keQ==?= Microsoft Excel Programming 4 28th Nov 2004 06:13 AM
How is Windows directory names and registry names case-insensitive? Elder Hyde Microsoft Dot NET Framework 6 18th Jan 2004 11:22 AM
document directory names no longer match names of user owners habiru Windows XP Security 1 15th Sep 2003 03:22 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:29 PM.