📄 index.jsp
字号:
<%@ page contentType="text/html;charset=GBK"%>
<%@ page import="java.sql.*" %>
<% request.setCharacterEncoding("GBK");%>
<jsp:useBean id="conn" scope="page" class="load.DBManager"/>
<%!
ResultSet rs=null;
String sql="";
%>
<html>
<head>
<title>我的软件仓库</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body text=#000000 bgcolor="#FFFFFF">
<center>
<%@ include file="title.htm" %>
<h2>我的软件仓库-软件排行榜</h2>
</center>
<%
sql="select Top 10 * from download order by hits desc";
rs=conn.executeQuery(sql);
while(rs.next()){
String hot="";
int i=0;
try{
i=rs.getInt("hits")/50;
}catch(Exception e){
}
if(i==0){
i=1;
}
if(i>=5){
i=5;
}
for(int j=1;j<=i;j++){
hot=hot+"★";
}
try{
conn.executeUpdate("update download set hot='"+hot+"' where id="+rs.getInt("id"));
}catch(Exception e){
}
out.print(conn.rsToGbook(rs));
}
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -