?? 0222.htm
字號:
<html>
<head>
<title>新時代軟件教程:操作系統(tǒng) 主頁制作 服務(wù)器 設(shè)計軟件 網(wǎng)絡(luò)技術(shù) 編程語言 文字編輯</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">---摘自互聯(lián)網(wǎng)</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>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -