Looping through files in a directory

Giganews Newsgroups
Subject: Looping through files in a directory
Posted by:  Michel (Mich…@discussions.microsoft.com)
Date: Sun, 30 Aug 2009

Hello,

In a directory, I have a list of following files

John_1
John_2
Peter_1
Peter_2
Peter_3
Simon_1

etc. ...

I want to display the names of files that begin with Peter_ in a listbox.
How can I loop through the files in that directory and display only those
files that begin with 'Peter_'?

Many thanks for your help and greetings,

Michel

Replies