473,396 Members | 1,963 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,396 software developers and data experts.

chosing specific files in a directory

What im trying to do is have all .mp3, .wma, and .wav files in the chosen directory go on a list. I've been at this for several days and came up with nothing. Any suggestions?

Expand|Select|Wrap|Line Numbers
  1. On Error Resume Next
  2. Dim i As Integer, splitfilename() As String
  3. flstSongs.Path = dirMusic.Path
  4. If flstSongs.ListCount <> 0 Then
  5.     For i = 1 To flstSongs.ListCount - 1
  6.         splitfilename = Split(flstSongs.List(i), ".", 2)
  7.         splitfilename(1) = LCase(splitfilename(1))
  8.         Select Case splitfilename(1)
  9.             Case "mp3"
  10.                 MsgBox "MP3"
  11.                 frmAmperage.lstFilePath.AddItem dirMusic.Path & "\splitfilename(0)"
  12.                 frmAmperage.lstFilename.AddItem splitfilename(0)
  13.                 i = i + 1
  14.             Case "wma"
  15.                 MsgBox "WMA"
  16.                 frmAmperage.lstFilePath.AddItem dirMusic.Path & flstSongs.FileName
  17.                 frmAmperage.lstFilename.AddItem flstSongs.FileName
  18.                 i = i + 1
  19.             Case "wav"
  20.                 MsgBox "WAV"
  21.                 frmAmperage.lstFilePath.AddItem dirMusic.Path & flstSongs.FileName
  22.                 frmAmperage.lstFilename.AddItem flstSongs.FileName
  23.                 i = i + 1
  24.             Case Else
  25.                 i = i + 1
  26.         End Select
Mar 21 '08 #1
3 790
Does anybody have any ideas?
Mar 23 '08 #2
Does anybody have any ideas?
why you dont try to use filelistbox,dir and drive list box ocx?
it would be easier for your. set the filter at the filelistbox ocx.
Mar 23 '08 #3
Good idea, I'll try it out. Thanks
Mar 30 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Angela | last post by:
I'm creating a Web Setup App, and I've been having many problems with it alongthe way. Some still aren't solved. This latest problem is that I can't install the application into the directory I...
2
by: Amy L. | last post by:
I am working on some code that will be used in a Windows Service that will monitor specific files in a queue. I would like to get an integer value of the amount of specfic files in a directory. ...
6
by: E Pease | last post by:
I have been trying to edit the Explorer example by Dev Ashish I found on www.msvp.org (I think). I have been all over the net so I am not quite sure where the file came from. I like the way it...
2
by: Darrel | last post by:
My app has an 'admin' folder. This is the only directory i need to apply forms authentication to. Googling seems to indicate that the solution is to just give the admin folder it's own config...
4
by: Prasad | last post by:
Hi, What are the different considerations/guidelines in chosing raw device or file containers for DMS tablespaces? A link would be very helpful. Thanks, Prasad.
9
by: Laurent ARNAL | last post by:
Hi, I would like to know if there is a way to remove/disable .php handler when the request come from a specific Browser. I ask this because I use dreamweaver / webdav to edit my .php files....
2
by: soniamadtha | last post by:
hello everyone, i am working on perltk where i need to browse on a directory for specific files (.sql extension).however it seems to be more complicated when i have to filter some files from...
13
by: Adhal | last post by:
Hi, How can I stop hotlinking to a specific file, and I want it to redirect it to a PHP link so I can monitor the number of downloads. Here is my site with the download page:...
3
by: Ned White | last post by:
Hi All, I would like to create a httphandler to set text watermark on image files before it gets displayed to the user. But this handler must listen specific folder or virtual directory(on same...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.