How to get the file list in a directory?

Status
Not open for further replies.

heo83

Junior Member level 3
Joined
Jul 7, 2004
Messages
25
Helped
2
Reputation
4
Reaction score
0
Trophy points
1,281
Activity points
226
I have a directory name My music and I want to print all the songs titles in that folder. There are many titles so I can't type. I know C, but it can not get the long file name. Does anyone here know how?
Using Visual C++ or VBasic is OK, C is rather good.
Thanks for reading
 

VB(A) sample using FileSystemObject :

Set fso = CreateObject ("Scripting.FileSystemObject")
Set f = fso.GetFolder("C:\mydir")
For Each file In f.Files
MsgBox f.Name
Next
 

    heo83

    Points: 2
    Helpful Answer Positive Rating
MsgBox f.Name must be : MsgBox file.Name
sorry for the mistake
 

For dos look for the dir.h declared functions .
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…