|
![]() |
名片设计 CorelDRAW Illustrator AuotoCAD Painter 其他软件 Photoshop Fireworks Flash |
|
<%@ page language=javascript %><html> <!-- dir.jsp -- Creates a page recursively listing all subdirectories and files. --> <head><title>Directory Listing</title></head> <body bgcolor=#ffffff> <h1>Directory Listing</h1> <% // // Resin file I/O roughly follows java.io with the exceptions: // 1) All filenames are urls using \\\'/\\\' as the filename separator. // 2) The myriad stream classes, readers, and writers are coalesced // into a single stream object. // // This function recursively lists the directory contents. // // Example: // // top // <ul> // <li>sub1 // <li>sub2 // <ul> // <li>subsub // </ul> // </ul> // function readdir(path) { out.writeln(path.path.split(\\\'/\\\').reverse()[0]); if (path.isDirectory()) { out.writeln("<ul>"); for (file in path.list()) { out.write("<li>"); readdir(path(file)); } out.writeln("</ul>"); } } readdir(File("data")); %> </body> </html> 返回类别: 教程 上一教程: JSP访问数据库的问题整理 下一教程: 四、处理表单数据 您可以阅读与"一个读取文件和子目录列表的程序"相关的教程: · java程序的递归算法,列出某个目录下的所有子目录和文件 · 从JAVA档案(JAR)中读取文件 · java io读取文件到String · 一个向数据库存取IMAGE文件的JSP程序 · JSP中读取远程机器的PROPERTIES文件和IP地址 |
![]() ![]() |
快精灵印艺坊 版权所有 |
首页![]() ![]() ![]() ![]() ![]() ![]() ![]() |