📄 index.jsp
字号:
<%@ page language="java" contentType="text/html; charset=GBK" pageEncoding="GB18030" import="java.sql.*,java.util.*,java.io.*"%>
<%@ include file="config.ini"%>
<%@ include file="conn.jsp"%>
<%@ include file="readlogin.jsp"%>
<%
try{
//读取存储在session中的登录用户id查询出用户的登录名
sqlstr="select username from users where id="+iCan;
rs=iCanDb.doSelect(sqlstr);
rs.next();
//接收提交的用户登录名
String username=rs.getString("username");
//读取存储在session中的登录用户id查询出登录用户存储在通讯簿中联系人的数目
int notecount=0;
sqlstr="select id from note1 where user='"+iCan+"'";
rs=iCanDb.doSelect(sqlstr);
if(rs.next())
{
rs.last();
notecount=rs.getRow();
}
//读取存储在session中的登录用户id查询出登录用户存储在记事本中记录信息的条数
int listcount=0;
sqlstr="select id from list where user='"+iCan+"'";
rs=iCanDb.doSelect(sqlstr);
if(rs.next())
{
rs.last();
listcount=rs.getRow();
}
//读取存储在session中的登录用户id查询出登录用户存储在收藏夹中收藏记录的个数
int favcount=0;
sqlstr="select id from fav where user='"+iCan+"'";
rs=iCanDb.doSelect(sqlstr);
if(rs.next())
{
rs.last();
favcount=rs.getRow();
}
//使用File类中的各个方法,判断用户空间中上传文件的个数
int boxcount=0;
long userBoxSize=0;
String iCanroot=dirPath.replace('\\','/');
File userBox=new File(iCanroot+"box/"+iCan);
File userBoxfile[]=userBox.listFiles();
if(userBoxfile.length>0)
{
for(int i=0;i<userBoxfile.length;i++)
{
if(userBoxfile[i].isFile())
{
userBoxSize=userBoxSize+userBoxfile[i].length();
}
}
boxcount=(int)userBoxSize/1024/1024;
}
%>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<%@ include file="head.jsp"%>
</head>
<body>
<center>
<table border="0" width="768" id="table1" cellspacing="0" cellpadding="0">
<tr>
<%@ include file="top.jsp"%>
</tr>
<tr>
<td width="90" valign="top">
<%@ include file="menu.jsp"%> </td>
<td width="588" valign="top">
<table border="0" width="100%" id="table3" cellspacing="0" cellpadding="0">
<tr>
<td>
<table border="1" width="100%" id="table4" bordercolorlight="#0A9EE4" cellspacing="0" cellpadding="5" bordercolordark="#0A9EE4">
<tr>
<td>
<table border="0" width="100%" id="table5" cellspacing="0" cellpadding="0">
<tr>
<td width="67%" valign="bottom">
<font color="#0A9EE4"> <%=username%>,欢迎你回来!</font></td>
<td width="33%">
<p align="right">
<img src=images/welcome.jpg width="80" height="80"> </td>
</tr>
<tr>
<td colspan="2">
<hr noshade color="#0A9EE4" size="1"></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2">
<table border="0" width="574" id="table6" cellspacing="0" cellpadding="0">
<tr>
<td width="287">
<table border="0" width="195" id="table7" cellspacing="0" cellpadding="0">
<tr>
<td rowspan="3" width=30>
</td>
<td rowspan="3">
<a href="list.jsp" target="_top">
<img src="images/list.jpg" width="80" height="80" style="border-style: solid; border-width: 0"></a></td>
<td width="77" valign="top"><b>
<font color="#0A9EE4" style="font-size: 9pt" face="宋体">[
<a target="_top" href="list.jsp">
<font color="#0A9EE4">通讯录</font></a> ]</font></b></td>
</tr>
<tr>
<td width="77" valign="middle" height="55">
<p align="left">
<span style="font-size: 9pt">
您可以把熟人的联系方式记在这里</span></td>
</tr>
<tr>
<td width="77" valign="top">
<span style="font-size: 9pt">
共<%=listcount%>条记录</span></td>
</tr>
</table>
</td>
<td width="287" align=right>
<table border="0" width="195" id="table8" cellspacing="0" cellpadding="0">
<tr>
<td width=78>
<p align="right">
<b>
<font color="#0A9EE4" style="font-size: 9pt" face="宋体">[
<a target="_top" href="note.jsp">
<font color="#0A9EE4">记事本</font></a> ]</font></b></td>
<td rowspan="3" width=87 align=right>
<p align="center">
<a href="note.jsp" target="_top">
<img src="images/note.jpg" width="80" height="80" style="border-style: solid; border-width: 0" align="right"></a></td>
<td rowspan="3" width=30>
</td>
</tr>
<tr>
<td width=78 height="51">
<p align="left">
<span style="font-size: 9pt">
把发生的点滴都写在这里,今后回味</span></td>
</tr>
<tr>
<td width=78>
<p align="right">
<span style="font-size: 9pt">
共<%=notecount%>条记录</span></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2" height="20"> </td>
</tr>
<tr>
<td colspan="2">
<p align="center"> <img src="images/logo.jpg" width="178" height="120" style="border-style: solid; border-width: 0"></td>
</tr>
<tr>
<td colspan="2" height="20"> </td>
</tr>
<tr>
<td>
<table border="0" width="195" id="table9" cellspacing="0" cellpadding="0">
<tr>
<td rowspan="3" width=30>
</td>
<td rowspan="3">
<a href="fav.jsp" target="_top">
<img src="images/fav.jpg" width="80" height="80" style="border-style: solid; border-width: 0"></a></td>
<td width="77" valign="top"><b>
<font color="#0A9EE4" style="font-size: 9pt" face="宋体">[
<a target="_top" href="fav.jsp">
<font color="#0A9EE4">收藏夹</font></a> ]</font></b></td>
</tr>
<tr>
<td width="77" valign="middle" height="55">
<p align="left">
<span style="font-size: 9pt">
网上有什么让你心动,就一定要收藏</span></td>
</tr>
<tr>
<td width="77" valign="top">
<span style="font-size: 9pt">
共<%=favcount%>条记录</span></td>
</tr>
</table>
</td>
<td align=right>
<table border="0" width="195" id="table10" cellspacing="0" cellpadding="0">
<tr>
<td width=78>
<p align="right">
<b>
<font color="#0A9EE4" style="font-size: 9pt" face="宋体">[
<a target="_top" href="box.jsp">
<font color="#0A9EE4">储藏箱</font></a> ]</font></b></td>
<td rowspan="3" width=87 align=right>
<p align="center">
<a href="box.jsp" target="_top">
<img src="images/box.jpg" width="80" height="80" style="border-style: solid; border-width: 0" align="right"></a></td>
<td rowspan="3" width=30>
</td>
</tr>
<tr>
<td width=78 height="51">
<p align="left">
<span style="font-size: 9pt">
有什么要存在网上,他会让你很方便</span></td>
</tr>
<tr>
<td width=78>
<p align="right">
<span style="font-size: 9pt">
共用<%=boxcount%>mb</span></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td width="90"> </td>
</tr>
<tr>
<td width="90" valign="top">
</td>
<td width="588" valign="top">
<%@ include file="copyright.jsp"%>
</td>
<td width="90"> </td>
</tr>
</table>
<p>
</center>
</p>
</body>
</html>
<%
}
catch(Exception e)
{
}
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -