📄 index.jsp
字号:
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@ page import="java.io.*" %>
<%@ page import="szpay.cn.File.*" %>
<%@ include file="Config.jsp" %>
<%@ include file="../../mBase/Config.jsp" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title><%=title%>::<%=nTitle%></title>
<LINK REL="stylesheet" HREF="../../images/szpay.css" TYPE="text/css">
</head>
<body>
<center>
<jsp:include page="../../mBase/Head_2.jsp"/>
<DIV class="w">
<H1>标题:<%=title%></H1>
</DIV>
<jsp:include page="../../mBase/AD_928x90_top.jsp"/>
<%
response.setCharacterEncoding("UTF8"); //设置编码格式
String str_page=request.getParameter("page");
String path_file = "";
String pathT = BaseDB +mUrl + "txt/"; //建立代表目前目录位置的d变量
int current_page;
if (str_page==null||str_page=="")
{
current_page=1;
}
else
{
current_page = Integer.parseInt(str_page);
}
mPage FPage = new mPage(); //取得目前目录的磁盘目录
String path_txt=request.getRealPath( pathT );
java.io.File d = new java.io.File(path_txt); //取得代表目录中所有文件
java.io.File list[] = d.listFiles();
int count = list.length;
int numofpage;
if (count%perpage==0)
numofpage=(int)(count/perpage);
else
numofpage=(int)(count/perpage)+1;
if (current_page>numofpage)page=numofpage;
int pagemin=FPage.min((current_page-1)*perpage , count-1);
int pagemax=FPage.min(pagemin+perpage-1, count);
String fenye=FPage.ShowList(count,current_page,numofpage,perpage,"index.jsp?");
%>
<DIV id="post">
<DIV class="l">
<DIV class="n">
<%=fenye%>
</DIV>
</DIV>
<DIV class="r">
<a class="p" href="Post.jsp">回复文章</a>
<a class="p" href="Photo.jsp">回复图片</a>
</DIV>
</DIV>
<%
if (list!=null && count>0){
for(int i=pagemin; i <pagemax; i++)
{
path_file=path_txt + "/"+ list[i].getName();
File file = new File(path_file);
FileInputStream fin = new FileInputStream(file);
BufferedReader br=new BufferedReader(new InputStreamReader(fin)); //建立BufferedReader对象,并实例化为br
String Line=br.readLine(); //从文件读取一行字符串
while(Line != null){ //判断读取到的字符串是否不为空
out.println(Line);
Line=br.readLine();//从文件中继续读取一行数据
}
br.close();
fin.close();
}
}
else
{
%>
<DIV id="content" class="w">
<DIV id="Text">
<h2>提示:暂时还没有<%=title%>相关内容</h2>
</DIV>
</DIV>
<%
}
%>
<DIV id="page">
<DIV class="pl">
<DIV class="n">
<%=fenye%>
</DIV>
</DIV>
<DIV class="pr">
<A href="../../index.jsp">版块查看</A>
<SELECT onchange=window.location.href=this.options[this.selectedIndex].value; name=region>
<option selected value="#" >请选择分类....</option>
<option value="../../mForum/index.jsp" >『盈盈论坛』程序发布</option>
<option value="../../mJsp/index.jsp" >JSP编程技术交流区</option>
<option value="../../mOracle/index.jsp" >Oracle数据库技术交流</option>
<option value="../../mSuggest/index.jsp" >盈盈通发展方向建议</option>
<option value="../../mTrash/index.jsp" >论坛帖子垃圾回收站</option>
</SELECT>
</DIV>
</DIV>
<jsp:include page="../../mBase/AD_928x90_down.jsp"/>
<jsp:include page="../../mBase/Footer_1.jsp"/>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -