close

 

The method list() in the File class can help you to achieve this purpose.

for example :

 

public static void main(String args[])

{


File dir = new File(directory);

String[] files = dir.list();

System.out.println(files.length);

}

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 JerryCheng 的頭像
    JerryCheng

    KwCheng's blog

    JerryCheng 發表在 痞客邦 留言(0) 人氣()