Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
Visual Basic Forum for Visual Basic Programmers VB Forum Index » API

Post new topic   Reply to topic
Dir list
View previous topic :: View next topic  
Author Message
Duckdude227
Newbie


Joined: 07 Jun 2005
Posts: 6

PostPosted: Jun 8th, 2005 06:49 PM    Post subject: Dir list Reply with quote

I am trying to get a dropdown box that has a list of dirictories in it.
_________________
There are 10 types of people in this world, those who understand binary and those who don't.

Smile
Back to top
View user's profile Send private message AIM Address
rbgCODE
Regular


Joined: 11 Nov 2004
Posts: 54
Location: Manchester CT

PostPosted: Jun 13th, 2005 01:57 PM    Post subject: Reply with quote

Code:

Function ExtractAll(ByVal FilePath As String, Optional DefaultExtension As String = "*.*") As String
Dim i, t
Dim RetVal As String
Dim MyName As String
Dim SubDir(500) As String
Static cnt As Long
 If Mid$(FilePath, Len(FilePath), 1) <> "\" Then
  FilePath = FilePath + "\"
 End If
 i = 0
On Error GoTo nodir
 MyName = Dir(FilePath, vbDirectory)
 Do While MyName <> ""
  If MyName <> "." And MyName <> ".." And MyName <> "Directories" Then
   If (GetAttr(FilePath & MyName) And vbDirectory) = vbDirectory Then
    SubDir(i) = MyName
    i = i + 1
   End If
  End If
  MyName = Dir
 Loop
 DoEvents
 If bolStop = True Then GoTo cExit
 MyName = Dir(FilePath + DefaultExtension, vbNormal)
 Do While MyName <> ""
  If Right(LCase(MyName), 3) = Right(txtExtension, 3) Then
   RetVal = RetVal + FilePath + MyName + "^"
   cnt = cnt + 1
   Status.Panels(1).Text = "Searching files " + cnt
   Status.Refresh
   DoEvents
  End If
  MyName = Dir
 Loop
nodir:
Dim RetVal2 As String
 For t = 0 To i - 1
  RetVal2 = RetVal2 + ExtractAll(FilePath & SubDir(t) + "\")
 Next t
cExit:
 ExtractAll = RetVal + RetVal2
 Exit Function
End Function

_________________
'><>
'rBg
'><>
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
Duckdude227
Newbie


Joined: 07 Jun 2005
Posts: 6

PostPosted: Jun 13th, 2005 03:19 PM    Post subject: Reply with quote

When i tried that it gave me a lot of errors and didn't work.
_________________
There are 10 types of people in this world, those who understand binary and those who don't.

Smile
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    Visual Basic Forum for Visual Basic Programmers VB Forum Index » API All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Visual Basic Forum runs phpBB | Forum Template © iOptional
VB Resources | SSL | Visual Basic