📄 0222.htm
字号:
<html>
<head>
<title>新时代软件教程:操作系统 主页制作 服务器 设计软件 网络技术 编程语言 文字编辑</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style>
<!--
body, table {font-size: 9pt; font-family: 宋体}
a {text-decoration:none}
a:hover {color: red;text-decoration:underline}
.1 {background-color: rgb(245,245,245)}
-->
</style>
</head>
<p align="center"><script src="../../1.js"></script></a>
<p align="center"><big><strong>一个读取文件和子目录列表的程序</strong></big></p>
<div align="right">---摘自互联网</div>
<br><%@ page language=javascript %><html><br>
<!-- dir.jsp<br>
-- Creates a page recursively listing all subdirectories and files.<br>
--><br>
<head><title>Directory Listing</title></head><br>
<body bgcolor=#ffffff><br>
<br>
<h1>Directory Listing</h1><br>
<br>
<%<br>
//<br>
// Resin file I/O roughly follows java.io with the exceptions:<br>
// 1) All filenames are urls using '/' as the filename separator.<br>
// 2) The myriad stream classes, readers, and writers are coalesced <br>
// into a single stream object.<br>
//<br>
// This function recursively lists the directory contents.<br>
// <br>
// Example:<br>
//<br>
// top<br>
// <ul><br>
// <li>sub1<br>
// <li>sub2<br>
// <ul><br>
// <li>subsub<br>
// </ul><br>
// </ul><br>
//<br>
function readdir(path)<br>
{<br>
out.writeln(path.path.split('/').reverse()[0]);<br>
if (path.isDirectory()) {<br>
out.writeln("<ul>");<br>
for (file in path.list()) {<br>
out.write("<li>");<br>
readdir(path(file));<br>
}<br>
out.writeln("</ul>");<br>
}<br>
}<br>
<br>
readdir(File("data"));<br>
<br>
%><br>
<br>
</body><br>
</html>
</table>
<p align="center"><script src="../../2.js"></script></a>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -