<%@ page contentType="text/html; charset=gb2312" language="java" import="java.io.*"%>
<%
File f=new File("c:/winnt");
File[] file=f.listFiles();
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head><body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>程序名称</td>
<td>代码行数</td>
<td>备注</td>
</tr>
<%
for(int j=0;j<file.length;j++){
if(file[j].getName().endsWith(".ini")==false){
continue;
}
BufferedReader br=new BufferedReader(new FileReader(file[j]));
int k=0;
while(br.readLine()!=null){
k++;
}
%>
<tr>
<td><%=file[j].getName()%></td>
<td><%=k%></td>
<td> </td>
</tr>
<% } %>
</table>
<br><br>
</body>
</html>
<%
File f=new File("c:/winnt");
File[] file=f.listFiles();
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head><body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>程序名称</td>
<td>代码行数</td>
<td>备注</td>
</tr>
<%
for(int j=0;j<file.length;j++){
if(file[j].getName().endsWith(".ini")==false){
continue;
}
BufferedReader br=new BufferedReader(new FileReader(file[j]));
int k=0;
while(br.readLine()!=null){
k++;
}
%>
<tr>
<td><%=file[j].getName()%></td>
<td><%=k%></td>
<td> </td>
</tr>
<% } %>
</table>
<br><br>
</body>
</html>
可以,但要用策略文件。否则就是黑客。