📄 listfile.asp
字号:
<%if(pagecount==0) pagecount=1;
for(C=1;C<=pagecount;C++){%><option value=<%Response.Write(C);
if(page==C) Response.Write(" selected")%>><%=C%></option>
<%}%></select>
页。(共 <font color=red><%=recordcount%></font> 条记录)</td></tr></table>
</td></tr></table>
<div style="position:absolute;display:none;top:expression((document.body.clientHeight-320)/2+body.scrollTop);left:expression((document.body.clientWidth-400)/2)" id=WenZhang>
<table border width=400 border bordercolor=black bordercolordark=white cellpadding=0 cellspacing=0>
<tr bgcolor=000070>
<th align=center height=20><font color=white>添加文章</font></th></tr>
<tr bgcolor=menu><td>
<table><tr>
<form action=<%=FileName%>?模块=管理&操作=添加 method=post>
<td width=77 align=center>文章标题</td><td><input size=41 name=BiaoTi></td></tr>
<tr><td align=center>所属分类</td>
<td><select onchange="FenLei.value=value">
<option>选择分类</option>
<%sql="Select distinct FenLei from Article where ShanChu=0";
rs.Open(sql,conn);
while(!rs.eof){%><option value="<%=rs(0)%>"><%=rs(0)%></option>
<%rs.MoveNext();}
rs.Close();%>
</select>
<input name=FenLei size="20"></td></tr>
<tr><td align=center valign=top>详细内容</td>
<td><textarea name=NeiRong rows=10 cols=40></textarea></td></tr>
<tr><td align=center>作者</td><td>
<input name=ZuoZhe value="<%=WangZhan%>" size="20"></td></tr>
<tr><td align=center>来源</td><td><input name=LaiYuan size=41 value=<%=WangZhi%>></td></tr>
<tr><td colspan=2 align=center><input type=button value=关闭 onclick="WenZhang.style.display='none'">
<input type=submit value=添加></td>
</form></tr></table>
</td></tr></table></div><%break;
/*********** 用户模块 **************/
case "用户":
FangFa=Request.Form("TiJiao")+"";
if(FangFa=="添加"&&Session("Access")=="Admin"){
sql="Select count(*) from User";
rs.open(sql,conn);
BH=rs(0)+"";
rs.Close();
YongHu=Request.Form("YongHu");
MiMa=Request.Form("MiMa");
QuanXian=Request.Form("QuanXian");
ShanChu=Request.Form("ShanChu");
sql="insert into User values("+BH+",'"+YongHu+"','"+MiMa+"',"+QuanXian+","+ShanChu+")";
conn.Execute(sql);}
if(FangFa=="保存"&&Session("Access")=="Admin"){
BH=Request.Form("BH");
YongHu=Request.Form("YongHu");
MiMa=Request.Form("MiMa");
QuanXian=Request.Form("QuanXian");
ShanChu=Request.Form("ShanChu");
sql="update User set YongHu='"+YongHu+"',MiMa='"+MiMa+"',QuanXian="+QuanXian+",ShanChu="+ShanChu+" where BH="+BH;
conn.Execute(sql);}%><br>
<table cellpadding=0 cellspacing=0 border=1 bordercolor=456789 bordercolordark=white align=center width=770>
<tr><td bgcolor=abcdef align=center width=210><br>
<p><a href=<%=FileName%>>返回首页</a></p>
<p><a href=<%=FileName%>?模块=管理>文章管理</a></p><%if(Session("Access")=="Admin"){%>
<p>用户管理</p>
<p><a href=<%=FileName%>?模块=设置>版权设置</a></p><%}%>
<p><a href=<%=FileName%>?模块=登录>退出登录</a></p>
<br></td><td>
<table><tr>
<form action=<%=FileName%>?模块=用户 method=post onsubmit="return confirm('确定要添加用户 '+YongHu.value+' 吗?\n\n(添加后只可禁用,不可删除。)')">
<td align=center><h3>用户管理</h3>
用户:<input size=10 name=YongHu>
密码:<input type=password name=MiMa size=10>
<select name=QuanXian><option value=0>普通用户</option>
<option value=1>管理员</option></select>
<select name=ShanChu><option value=0>启用</option>
<option value=1>禁用</option></select>
<input type=submit value=添加 name=TiJiao></td>
</form></tr>
<tr height=1 bgcolor=abcdef><td></td></tr><%sql="Select * from User order by BH desc";
if(Session("Access")=="Admin"){
rs.open(sql,conn);
while(!rs.eof){%>
<tr><form action=<%=FileName%>?模块=用户 method=post><input type=hidden name=BH value=<%=rs(0)%>>
<td align=center>用户:<input size=10 name=YongHu value=<%=rs(1)%>>
密码:<input type=password name=MiMa size=10 value=<%=rs(2)%>>
<select name=QuanXian><option value=0>普通用户</option>
<option value=1<%if(rs(3)==1) Response.Write(" selected")%> style="background:abcdef">管理员</option></select>
<select name=ShanChu><option value=0>启用</option>
<option value=1<%if(rs(4)==1) Response.Write(" selected")%> style="background:fedcba">禁用</option></select>
<input type=submit value=保存 name=TiJiao></td></form></tr>
<%rs.MoveNext();}
rs.Close();}%></table>
</td></tr></table>
<%break;
/*********** 版权设置 **************/
case "设置":
TiJiao=Request.Form("TiJiao")+"";
if(Session("Access")=="Admin"&&TiJiao=="保存"){
WangZhan=Request.Form("ZhanMing")+"";
WangZhi=Request.Form("WangZhi");
sql="update Copyright set ZhanMing='"+WangZhan+"',WangZhi='"+WangZhi+"'";
conn.Execute(sql);
Response.Write("<script>alert(\"保存成功\")</script>");}%><br>
<table cellpadding=0 cellspacing=0 border=1 bordercolor=456789 bordercolordark=white align=center width=770>
<tr><td bgcolor=abcdef align=center width=210><br>
<p><a href=<%=FileName%>>返回首页</a></p>
<p><a href=<%=FileName%>?模块=管理>文章管理</a></p><%if(Session("Access")=="Admin"){%>
<p><a href=<%=FileName%>?模块=用户>用户管理</a></p>
<p>版权设置</p><%}%>
<p><a href=<%=FileName%>?模块=登录>退出登录</a></p>
<br></td><td>
<table><tr>
<form action=<%=FileName%>?模块=设置 method=post>
<td align=center><h3>版权设置</h3>
站名:<input size=15 name=ZhanMing value=<%=WangZhan%>>
网址:<input name=WangZhi value=<%=WangZhi%> size=30>
<input type=submit value=保存 name=TiJiao></td>
</form></tr></table>
</td></tr></table>
<%break;
/*********** 默认界面 **************/
default:
ID=parseInt(Request.QueryString("ID"));
if(!isNaN(ID)){%><br>
<table width=770 cellspacing=0 cellpadding=0 border bordercolor=456789 bordercolordark=white align=center>
<tr><td>
<table width=87% align=center style="font:10.5pt/13pt 宋体;table-layout:fixed">
<tr><td style="word-wrap:break-word;word-break:break-all">
<%sql="select * from Article where ShanChu=0 and BH="+ID;
rs.Open(sql,conn);
if(!rs.eof){sql="update Article set DianJi=DianJi+1 where BH="+ID;
conn.Execute(sql);%><h3 align=center><%=rs(1)%></h3>
<center><b>作者:</b><%=rs(3)%> <b>日期:</b><%=rs(5)%><br>
<b>来源:</b><%=rs(4)%></center>
<p><%=rs(2)%></p>
<div align=right>
<%=WangZhan%><br>
<%=WangZhi%><br>
该文章被阅读了 <font color=red><%=rs(6)%></font> 次</div><%}
else{Response.Write("<center>错误:找不到该ID号的主题或该主题已经被删除。</center>");}
FenLei=""+rs(7);
rs.Close();%>
</td></tr></table>
</td></tr></table>
<table width=770 align=center><tr><td width=50% valign=top>
<table border width=100% bordercolor=456789 bordercolordark=white cellpadding=0 cellspacing=0>
<tr bgcolor=abcdef><td height=20><font color=456789>◆</font>
<b>热门文章</b></td></tr>
<tr><td><br><ul type=1><%sql="select top 7 BH,BiaoTi,RiQi,DianJi from Article where ShanChu=0 and FenLei='"+FenLei+"' order by DianJi DESC";
rs.Open(sql,conn);
C=0;
while(!rs.eof&&C<7){%>
<li><a href=<%=FileName%>?ID=<%=rs(0)%>><%=rs(1)%></a>
(<font color=green><%=rs(2)%></font>
<font color=red><%=rs(3)%></font>)</li><%C++;
rs.MoveNext();}
rs.Close();%>
</ul></td></tr></table>
</td><td width=50% valign=top>
<table border width=100% bordercolor=456789 bordercolordark=white cellpadding=0 cellspacing=0>
<tr bgcolor=abcdef><td height=20><font color=456789>◆</font>
<b>相关文章</b></td></tr>
<tr><td><br><ul type=1><%sql="select top 7 BH,BiaoTi,RiQi,DianJi from Article where ShanChu=0 and FenLei='"+FenLei+"' order by RiQi DESC";
rs.Open(sql,conn);
C=0;
while(!rs.eof&&C<7){%>
<li><a href=<%=FileName%>?ID=<%=rs(0)%>><%=rs(1)%></a>
(<font color=green><%=rs(2)%></font>
<font color=red><%=rs(3)%></font>)</li><%C++;
rs.MoveNext();}
rs.Close();%>
</ul></td></tr></table>
</td></tr></table><%}
else{%><br><table width=770 align=center cellpadding=0 cellspacing=0>
<tr><td width=230 valign=top>
<table cellpadding=0 cellspacing=0 border bordercolor=456789 bordercolordark=white>
<tr bgcolor=abcdef><td height=20><font color=456789>◆</font>
<b>近期热门文章</b></td></tr>
<tr><td><br><ul type=1><%FenLei=Request.QueryString("分类")+"";
FenLei=FenLei.replace(/'/g,"''");
if(FenLei!="undefined"){FenLei=" and FenLei='"+FenLei+"'";}
else{FenLei="";}
sql="select top 17 BiaoTi,BH,DianJi from Article where ShanChu=0"+FenLei+" order by DianJi DESC";
rs.Open(sql,conn);
if(rs.eof) Response.Write("当前没有任何新的文章。");
C=0;
while(!rs.eof&&C<17){
Response.Write("<li>"+(""+rs(0)).link(FileName+"?ID="+rs(1))+"("+(""+rs(2)).fontcolor("red")+")</li>");
rs.MoveNext();
C++;}
rs.Close();%></ul></td></tr></table>
</td><td valign=top>
<table cellpadding=0 cellspacing=0 border bordercolor=456789 bordercolordark=white>
<tr bgcolor=abcdef><td height=20><font color=456789>◆</font>
<b><%if(Request.QueryString("分类")+""!="undefined"){%><%=Request.QueryString("分类")%><%}
else{%>全部文章<%}%></b></td></tr>
<tr><td><br><ul type=1><%Keyword=Request.QueryString("关键词")+"";
Keyword=Keyword.replace(/'/g,"''");
if(Keyword=="undefined"){Rule="";}
else{Rule=" and(BiaoTi like '%"+Keyword+"%' or NeiRong like '%"+Keyword+"%')";}
sql="select FenLei,BiaoTi,BH,RiQi,DianJi from Article where ShanChu=0"+FenLei+Rule+" order by RiQi DESC";
rs.Open(sql,conn,1);
rs.pagesize=27;
page=parseInt(Request.QueryString("页码"));
if(isNaN(page)||page<1) page=1;
if(page>rs.pagecount) page=rs.pagecount;
if(rs.eof){Response.Write("当前没有任何新的文章。");}
else{rs.absolutepage=page;
for(C=0;C<rs.pagesize;C++){
FenLei=Request.QueryString("分类")+"";
FenLei=FenLei.replace(/'/g,"''");
if(FenLei=="undefined"){FenLei="["+(rs(0)+"").link(FileName+"?分类="+rs(0))+"] ";}
else{FenLei="";}
Response.Write("<li>"+FenLei+(""+rs(1)).link(FileName+"?ID="+rs(2))+"("+(""+rs(3)).fontcolor("456789")+" "+(""+rs(4)).fontcolor("green")+")</li>");
rs.MoveNext();
if(rs.eof) break;}}
pagecount=parseInt(rs.pagecount);
recordcount=parseInt(rs.recordcount);
rs.Close();%></ul></td></tr>
<tr><td height=30> <%FenLei=Request.QueryString("分类")+"";
if(page>1){%>[<a href="<%=FileName%><%if(FenLei!="undefined") Response.Write("?分类="+FenLei);if(Keyword!="undefined"){if(FenLei=="undefined"){Response.Write("?");}else{Response.Write("&");}Response.Write("关键词="+Keyword);}%>">首页</a>] [<a href="<%=FileName%>?页码=<%=page-1%><%if(FenLei!="undefined") Response.Write("&分类="+FenLei);if(Keyword!="undefined") Response.Write("&关键词="+Keyword);%>">上一页</a>] <%}%><%if(page!=pagecount){%>[<a href="<%=FileName%>?页码=<%=page+1%><%if(FenLei!="undefined") Response.Write("&分类="+FenLei);if(Keyword!="undefined") Response.Write("&关键词="+Keyword);%>">下一页</a>] [<a href="<%=FileName%>?页码=<%=pagecount%><%if(FenLei!="undefined") Response.Write("&分类="+FenLei);if(Keyword!="undefined") Response.Write("&关键词="+Keyword);%>">最后</a>] <%}%>跳转到第
<select onchange="location.replace('<%=FileName%>?页码='+value<%if(FenLei!="undefined"||Keyword!="undefined") Response.Write("+'");
if(FenLei!="undefined") Response.Write("&分类="+FenLei);
if(Keyword!="undefined") Response.Write("&关键词="+Keyword);
if(FenLei!="undefined"||Keyword!="undefined") Response.Write("'");%>)">
<%if(pagecount<1) pagecount=1;
for(C=1;C<=pagecount;C++){%><option value=<%Response.Write(C);
if(page==C) Response.Write(" selected")%>><%=C%></option>
<%}%></select>
页。(共 <font color=red><%=recordcount%></font> 条记录)</td></tr>
<tr><form action=<%=FileName%>>
<td align=right>文章搜索:
<input name=关键词 size="20">
<select name=分类>
<option value=undefined>所有分类</option>
<%sql="Select distinct FenLei from Article where ShanChu=0";
rs.Open(sql,conn);
while(!rs.eof){%><option value="<%=rs(0)%>"<%if(rs(0)+""==FenLei) Response.Write(" selected")%>><%=rs(0)%></option>
<%rs.MoveNext();}
rs.Close();%>
</select>
<input type=submit value=搜索>
</td></form></tr></table>
</td></tr></table>
<%}}%><hr width=456 size=1><center>
版权所有:<%=WangZhan.link(WangZhi)%>
程序运行时间:
<tt style="width:35;background:123456;cursor:wait;text-align:center">
<font size=2 color=abcdef face=Impact>
<%JieShu=(new Date()).getTime();
Response.Write(JieShu-KaiShi);%></tt>
</font>毫秒</center>
</body></html><%conn.Close();
delete rs;
delete conn;%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -