Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting list of file names

Status
Not open for further replies.

bomayed

Technical User
May 13, 2002
101
AE
Does anyone know How get the names of all files in specific directory using VB6.0 ?
 
bomayed, I notice that although you have asked 59 questions to date, you haven't marked a single answer as helpful.

If you haven't got the answers that you need then read faq222-2244 to find how to get better answers.

If you have been getting your answers then read faq222-2244 to see how to properly acknowledge those answers.

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'
 
Thanks SonOfEmidec1100 , but when I use the DIR function:

list1.additem dir("c:\*.*")

I only get one file added . .

johnwm , I didn't know that I had to mark the answers. But now I know , so thanks.

 
A lot of people ask that question the first time the use Dir, you need to loop round to return each file in turn

Dim fname As String

fname = Dir("c:\*.*")
List1.Clear
Do Until fname = ""
List1.AddItem fname
fname = Dir
Loop
 
You're welcome!

You don't have to mark the answers, but it's always polite to say Thank you in some way, and the link

<Thank SonOfEmidec1100 for this valuable post!>

is designed to provide a shortcut for you, and act as a marker for other users to recognise a useful or valued response.

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top