动态网站制作指南



当前位置 > 网站建设学院 > 网络编程 > ASP技巧 Rss
Tag:注入,存储过程,分页,安全,优化,xmlhttp,fso,jmail,application,session,防盗链,stream,无组件,组件,md5,乱码,缓存,加密,验证码,算法,cookies,ubb,正则表达式,水印,索引,日志,压缩,base64,url重写,上传,控件,Web.config,JDBC,函数,内存,PDF,迁移,结构,破解,编译,配置,进程,分词,IIS,Apache,Tomcat,phpmyadmin,Gzip,触发器,socket

用排序串字段实现树状结构(例程——显示树)


发表日期:2000-8-8


程序index.asp
功能:显示目录树

<!-- #include file="lybcon.inc" --><%
pageno=request("pageno")
searchtype=request("searchtype")
searchnr=rtrim(request("searchnr"))
set guestconn=Server.CreateObject("ADODB.connection")
guestconn.Open lybstr
set guestrs=server.createobject("ADODB.recordset")
sqlstr="SELECT * FROM guestbook"
if searchnr<>"" then sqlstr=sqlstr&" where "&searchtype&" like '%%"&replace(searchnr,"'","''")&"%%'"
sqlstr=sqlstr&" order by rootid+(1-sign(rootid))*lybid desc,orderstr,lybid desc"
guestrs.open sqlstr,guestconn,1,1
rowcount=25
if pageno="" then pageno=1
if not guestrs.eof then
  if IsNumeric(pageno) then
    guestrs.pagesize=rowcount
    if pageno+1>guestrs.pagecount+1 then pageno=guestrs.pagecount
  else
    pageno=1
  end if
  guestrs.AbsolutePage=pageno
else
  pageno=1
end if
%><html>
<head><title>软件使用留言薄</title>
<style TYPE="text/CSS">
<!--
a {  text-decoration: none}
body {line-height:18px;font-size:9pt;font-family:宋体}
a:hover {color:#FF0000;text-decoration:none}
.submit {line-height:9pt;font-size:9pt;font-family:宋体}
.submit1 {line-height:8pt;font-size:8pt;font-family:宋体}
.selectform {font-family: 宋体; font-size: 9pt;background-color:ffE4E4}
td {font-family: 宋体; font-size: 9pt;background-color:ECF7FF}
.td1 {font-family: 宋体; font-size: 9pt;background-color:A2C8F2}
.td2 {font-family: 宋体; font-size: 9pt;background-color:E9EDE0}
.small1 {font-family: 宋体; font-size: 9pt;background-color:ffffff;line-height:9pt}
-->
</style>
<script language="javaScript1.2">
function d(sp,t,a,d,ti,l,id,rid,pn)
{
document.write("<tr><td>"+sp+"<a href='disPRec.asp?
keyid="+id+"&rootid="+rid+"&pageno="+pn+"'>"+t+"</a></td>");
document.write("<td align=right>"+a+" </td>");
document.write("<td nowrap align=center>"+d+" "+ti+"</td>");
document.write("<td align=right>"+l+" </td>");
document.write("<td align=right>"+id+" </td>");
document.write("</tr>");
}
</script>
</head>
<body topmargin=16>
<form name='index' method='POST' action='index.asp'>
<table width=100% align=center>
  <tr>
   <td align=center style='font-size:16px;background-color:ffffff;color:red' height=35 valign=top>软件使用
留言薄</td>
   <td align=center colspan=3 style='font-size:13px;background-color:ffffff' valign='bottom'>共<font
style='font-size:16px;color:red'><% =guestrs.recordcount %></font>条留言<font style='font-
size:16px;color:red'><% =guestrs.pagecount %></font>页目前第<font style='font-size:16px;color:red'><%
=pageno %></font>页</td>
   <td style='background-color:ffffff' valign=bottom><a href="/wen/swuselyb/index.asp">旧留言薄
</a></td></tr>
  <tr>
   <td class='td2' align='center'>搜索贴子
    <select name='searchtype' class='small1'>
     <option value='guestname' <% if searchtype="guestname" then response.write("selected") %>>贴子作者
</opion>
     <option value='guestcomm' <% if searchtype="guestcomm" then response.write("selected") %>>贴子内容
</opion>
    </select> <input type='text' name='searchnr' size=14 class='small1' value='<% =searchnr %>'> <a
href='Javascript:document.index.submit();'>开始搜索</a>
   </td>
   <td colspan=3 class='td2' align='center'><% if pageno+1>2 then %><a
href='javascript:document.index.pageno.value--;document.index.submit();'>上一页</a><% else %>上一页<% end
if %>  <% if pageno+1<guestrs.pagecount+1 then %><a
href='javascript:document.index.pageno.value++;document.index.submit();'>下一页</a><% else %>下一页<% end
if %>  到<input type='text' name='pageno' size=6 class='small1' value=<% =pageno %>>页</td>
   <td class='td2' align=center><a href='revert.asp?type=post'>发贴子</a></td>
  </tr>
  <tr style="color:red">
   <td align=center class='td1'>留言标题</td>
   <td align=center width=70 class='td1'><img src='edit.gif'>作  者</td>
   <td align=center width=100 class='td1'>发表时间</td>
   <td align=center width=60 class='td1' nowrap>贴子字数</td>
   <td align=center width=60 class='td1' nowrap>贴子序号</td>
  </tr>
<%
do while true
  if guestrs.eof then exit do
  if guestrs("rootid")=0 then exit do
  guestrs.movenext
loop
do while not guestrs.eof and rowcount>0 %><script>d('<% =replace(space(2*len(guestrs
("orderstr")))," "," ") %>','<% =guestrs("guestitle") %>','<% =guestrs("guestname") %>','<% =guestrs
("putdate") %>','<% =guestrs("puttime") %>',<% =len(guestrs("guestcomm")) %>,<% =guestrs("lybid") %>,<%
=guestrs("rootid") %>,<% =pageno %>)</script>
<%
rowcount=rowcount-1
guestrs.movenext
if not guestrs.eof then
  if guestrs("rootid")<>0 and rowcount=0 then rowcount=1
end if
loop
guestrs.close
set guestrs=nothing
guestconn.close
set guestconn=nothing
%>
</table>
</form>
<br><br><br>
</body>
</html>
关注此文的读者还看过:
·2012-5-17 12:26:46 CSLA.Net在Web项目中使用SQL2005的分页
·2012-5-17 12:26:03 对连串英文自动换行的解决方法 IE5.5 
·2012-5-17 12:26:02 用排序串字段实现树状结构(例程——显示贴子内容)
·2012-5-17 12:25:33 ASP+Access的安全隐患及对策
·2012-5-17 12:25:07 用排序串字段实现树状结构(例程——回复表单)
·2012-5-17 12:24:06 用err.raise自定义错误信息
·2012-5-17 12:24:06 用排序串字段实现树状结构(例程——保存贴子内容)
·2012-5-17 12:22:23 ASP中和星期有关的自定义函数
·2012-5-17 12:21:56 如何使用ASP产生象安装向导的主页
站长推荐 PS笔刷下载 在线翻译 系统进程 广告代码
  发表评论
姓 名: 验证码:
内 容:
教程搜索服务
ASP源码推荐
·搜搜搜软件搜索引擎 v1.3
·7744QQ小偷程序 v1.1
·酒店小偷采集程序 v2010
·新鲜志留言程序
·二指禅站长工具箱源码 build 20
· 简易个人博客LnBlog v1.0.0
·网趣购物系统加强版
·雷驰新闻系统 v1.0
·I'M Bin v1.0
·艾恩ASP无组件上传类(An-Upload
·飘扬企业网站系统 v1.02
·凯撒DJ站 v1.0 无错版
项目外包信息
·UI界面设计
·产品外观改版设计 15000元
·照明灯具网站设计 10000元
·求长期合作网站设计制作高手
·做B2C网站 20000元
·Android或QT软硬件平台设计(工
·网站首页FLASH
·网站PSD稿设计
·企业网站整站网页设计(美观大气
·网站页面设计及套入程序
·UI界面设计
·产品外观改版设计 15000元
·照明灯具网站设计 10000元
·求长期合作网站设计制作高手
·PPT设计
发布信息 浏览信息
邮件订阅服务
输入你的邮件地址,你将不会错过任何关于<ASP技巧>的内容


网络编程文章分类
ASP教程
ASP实例
ASP技巧
ASP文摘
PHP教程
PHP技巧
PHP实例
PHP文摘
JSP教程
JSP技巧
JSP实例
JSP文摘
ASP.NET教程
ASP.NET技巧
ASP.NET实例
ASP.NET应用
xml教程
xsl教程
xml技巧
C#教程
C#应用
Delphi教程
Perl教程
Shell教程
Ajax教程
Visual Basic教程
Java教程
J2EE/J2ME教程
C/C++教程
移动解决方案
移动短信技术
移动行业动态
软件工程
WordPress
Android开发
站长工具:Google PR查询|Alexa排名查询|网站速度测试|CSS在线编辑器|OPEN参数生成器|弹出式窗口代码产生器|密码登录生成器|在线按钮生成器|Meta标签生成器|邮箱图标在线生成|多色彩特效字代码生成器|网页代码调试器|在线FTP登陆|Flash取色器|配色代码对照表|配色辞典|CSS生成器|CSS在线压缩|广告代码|框架网页代码生成器|js/vbs加密|md5加密|进制转换|UTF-8 转换工具|在线调色板|Html转换js|Html转换asp|Html转换php|Html转换perl
实用工具:汉字翻译拼音|拼音字典|在线翻译|天气预报|火星文|在线网速测试|符号对照表|个税计算|理财工具|黄金价格|购房银行按揭利率计算|汇率查询|经典小工具|汉字简繁转换|普通单位换算|公制单位换算|生辰老黄历|国内电话区号|国家代码与域名缩写|文字加密解密|元素周期表|健康查询|世界时间|全国各地车牌查询|全国车辆交通违章查询|万年历|二十四节气|汉字横竖排版|手机号码查询|计算器|ip搜索|酒店预订|机票预订
广告刊登 | 版权声明 | 联系我们 | 加入收藏 | RSS订阅
Copyright © 2000-2012 www.knowsky.com All rights reserved | 沪ICP备05001343号