Here is an example that lists all the files on my desktop. you must change the path variable to your path.
Instead of printing the file name using System.out.println, you should put your own code to work with the file.
public static void main(String[] args) { File path = new File("c:/documents and settings/Zachary/desktop"); File [] files = path.listFiles(); for (int i = 0; i < files.length; i++){ if (files[i].isFile()){
WuHoUnited Feb 07 '11 at 1:00 2011-02-07 01:00
source share