Java file operations Daquan 5: directory listed in the document
Abstract: Java file operations Daquan 5: directory listed in the document
</ Td> </ tr> <tr> <td height="35" valign="top" class="ArticleTeitle"> <table width="734" border="0"> <tr> <td width = " 728 "> </ td> </ tr> </ table> ↑ Back Tags: File
<% @ Page contentType = "text / html; gb2312 charset ="%>
<% @ Page import = "java.io. *"%>
<head>
</ Head>
<body>
<%
String path = request.getRealPath ( "/ article/article5a/example/filetest");
File d = new File (path); / / set up the current directory in the File object files
File list [] = d.listFiles ();// made on behalf of all the files in the directory object array File
Out.println ( "" + path + "directory paper:
");
For (int i = 0; i
Out.println (list [i]. GetName () + "
");
)
)
Out.println ( "
"+ Path +" directory under the directory:
");
For (int i = 0; i
Out.println (list [i]. GetName () + "
");
)
)
%>
</ Body>
</ Td> </ tr> <tr>
Releated Java Articles
Comments
Leave a Reply






