📄 1.jsp
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" %>
<%@page import="java.sql.*"%>
<%@page import="java.io.*"%>
<%@page import="java.util.* "%>
<style type="text/css">
<!--
body,td,th {
font-family: 方正舒体;
font-size: 50px;
}
body {
background-image: url(1.jpg);
}
.STYLE1 {
color: #FF6633;
font-family: "华文彩云";
}
.STYLE5 {color: #FF0000}
.STYLE6 {font-size: 30}
.STYLE7 {color: #6699FF}
.STYLE8 {color: #FFCC00; }
.STYLE10 {
font-size: 25px;
color: #0033FF;
}
.STYLE11 {
color: #6699FF;
font-size: 30px;
font-family: "华文隶书";
}
.STYLE12 {font-family: "华文隶书"}
.STYLE13 {font-size: 25px; color: #0033FF; font-family: "华文隶书"; }
-->
</style><body>
<%
//首先声明一个字符型数组
//用于存放在文件中选择读取的字符
//out.println("首先从文件中读取从第一个字符开始的十一个字符<br>");
char choice_char[]=new char[3];
//得到ReadFile.txt文件在服务器端的路径
String FilePath=request.getRealPath("/");
//建立FileReader对象
FileReader FileRead=new FileReader(FilePath+"\\count.txt");
if(FileRead.read(choice_char,0,3)==-1)
{
out.println("文件中没有数据存在。");
}
FileRead.close();
String a=new String(choice_char);
int num=(int)(Integer.parseInt(a.trim()));
// out.println(Integer.toString(num));
Integer number=((Integer)application.getAttribute("count"));
if(number==null)
{
number=new Integer(1);
application.setAttribute("count",number);
num=num+1;
}
else
{
number=new Integer(number.intValue()+1);
application.setAttribute("count",number);
num=num+1;
}
// out.println(num.toString());
//建立FileWriter对象
FileWriter FileWrite=new FileWriter(FilePath+"\\count.txt");
//向文件WriteFile.txt中写入数据
FileWrite.write(Integer.toString(num));
//关闭FileWriter对象
FileWrite.close();
%>
<%!
//************************************
String G(Integer counter)
{
String S, myimage;
myimage = "";
S = counter.toString() ;
for(int i = 0; i<S.length(); i++)
{
myimage = myimage + "<IMG SRC=" + S.charAt(i) + ".GIF>";
}
return myimage;
}
%>
<script>
function clockon()
{
var now=new Date();
var year=now.getYear();
var month=now.getMonth();
var date=now.getDate();
var day=now.getDay();
var hour=now.getHours();
var minu=now.getMinutes();
var sec=now.getSeconds();
var week;
month=month+1;
if(month<10)month="0"+month;
if(date<10)date="0"+date;
if(hour<10)hour="0"+hour;
if(minu<10)minu="0"+minu;
if(sec<10)sec="0"+sec;
var arr_week=new Array("星期日","星期一","星期二","星期三","星期四","星期五","星期六");
week=arr_week[day];
var time="";
time=year+"年"+month+"月"+date+"日"+week+" "+hour+":"+minu+":"+sec;
Clock.innerHTML = time;
window.setTimeout("clockon();", 100);
}
window.onload =clockon;
</script>
<div align="center">
<p class="STYLE1">DSY 人事管理系统 </p>
</div>
<div align="center" id="Clock" class="STYLE13"></div>
<div align="center">
<p> <span class="STYLE13">我的地盘听我的</span></p>
</div>
<p align="justify" class="STYLE5"><span class="STYLE6"> <span class="STYLE12"><a href="2.jsp">登录</a> <a href="3.jsp">注册</a></span></span> <span class="STYLE13">
历史访问人数是<%=G((Integer)num)%></span> </p>
<p align="justify" class="STYLE5"> </p>
<pre class="STYLE11" align="justify"> DSY(Dong Shu Yan)人事管理系统
制作人:董淑燕
班级:软件051
学号:202050401
</pre>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -