网络编程 | 站长之家 | 网页制作 | 图形图象 | 操作系统 | 冲浪宝典 | 软件教学 | 网络办公 | 邮件系统 | 网络安全 | 认证考试 | 系统进程
Firefox | IE | Maxthon | 迅雷 | 电驴 | BitComet | FlashGet | QQ | QQ空间 | Vista | 输入法 | Ghost | Word | Excel | wps | Powerpoint
asp | .net | php | jsp | Sql | c# | Ajax | xml | Dreamweaver | FrontPages | Javascript | css | photoshop | fireworks | Flash | Cad | Discuz!
当前位置 > 网站建设学院 > 网络编程 > ASP技巧
Tag:注入,存储过程,分页,安全,优化,xmlhttp,fso,jmail,application,session,防盗链,stream,无组件,组件,md5,乱码,缓存,加密,验证码,算法,cookies,ubb,正则表达式,水印,索引,日志,压缩,base64,url重写,上传,控件,Web.config,JDBC,函数,内存,PDF,迁移,结构,破解,编译,配置,进程,分词,IIS,Apache,Tomcat,phpmyadmin,Gzip,触发器,socket
网络编程:ASP教程,ASP.NET教程,PHP教程,JSP教程,C#教程,数据库,XML教程,Ajax,Java,Perl,Shell,VB教程,Delphi,C/C++教程,软件工程,J2EE/J2ME,移动开发
本月文章推荐
.ASP实现多语言支持.
.错误80004005信息处理方法.
.用GetString来提高ASP的速度&nbs.
.关于分页办法.
.将ASP的Debug变得简单的两个函数.
.怎么样写一段高效,安全的sql查询.
.ASP开发中存储过程应用全接触 .
.用Xml2OleDb将XML文件插入到数据.
.如何使用asp创建dsn.
.如何增强ASP程序性能(2).
.巧妙破解开别人ASP木马密码的方法.
.Jmail中避过smtp验证的一法.
.大部分ADO的错误码对应的含义.
.让 Asp 与 XML 交互.
.SQL注入程序带来的攻击及防范.
.让ASP程序运行于非Windows平台.
.一个比较实用的asp函数集合类 .
.表单递交合法性检测-不允许指定字.
.建立自己的WEB平台.
.让你的WAP网站有更好的兼容性.

ASP+ACCESS实现的无限级目录树

发表日期:2004-9-10


下载地址:/download/treemenu.rar

关键代码:

<%
set conn=server.createobject("ADODB.CONNECTION")
connstr="DBQ="+server.mappath("db1.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
conn.open connstr
function menu(id)
set rs=server.CreateObject("adodb.recordset")
sql="select * from menu where id1="&id&" order by url,id"
rs.open sql,conn,1,1
if rs.recordcount=0 then
 rs.close
 set rs=nothing
 exit function
end if
response.write("<table border='0' cellspacing='0' cellpadding='0'>")
i=1
while not rs.eof
if len(rs("url"))>0 then
 if i=rs.recordcount then
  menutype="file1"
 else
  menutype="file"
 end if
 menuname="<a href='"&rs("url")&"' target='_blank'>"&rs("menuname")&"</a>"
 onmouseup=""
else
 if i=rs.recordcount then
  menutype="menu3"
  listtype="list1"
  onmouseup="with(eval('id"&rs("id")&"'))if(style.display==''){style.display='none';this.className='menu3';}else{style.display='';this.className='menu4';}"
 else
  menutype="menu1"
  listtype="list"
  onmouseup="with(eval('id"&rs("id")&"'))if(style.display==''){style.display='none';this.className='menu1';}else{style.display='';this.className='menu2';}"
 end if
 menuname=rs("menuname")
end if
%>
  <tr>
    <td class="<%= menutype%>" onMouseUp="<%= onmouseup%>"><%= menuname%></td>
  </tr>
<%if len(rs("url"))<3 then%>
  <tr id="id<%= rs("id")%>" style="display:none">
    <td class="<%= listtype%>"><%menu(rs("id"))%></td>
  </tr>
<%
end if
rs.movenext
i=i+1
wend
response.write("</table>")
rs.close
set rs=nothing
end function
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>=========无限级目录树=========</title>
<style type="text/css">
<!--
.menu1 {
 background-image: url(folder1.gif);
 background-repeat: no-repeat;
 height: 17px;
 left: 32px;
 padding-left: 32px;
 cursor: hand;
}
.menu2 {
 background-image: url(folder2.gif);
 background-repeat: no-repeat;
 height: 17px;
 left: 32px;
 padding-left: 32px;
 cursor: hand;
}
.menu3 {
 background-image: url(folder3.gif);
 background-repeat: no-repeat;
 height: 17px;
 left: 32px;
 padding-left: 32px;
 cursor: hand;
}
.menu4 {
 background-image: url(folder4.gif);
 background-repeat: no-repeat;
 height: 17px;
 left: 32px;
 padding-left: 32px;
 cursor: hand;
}
.list {
 padding-left: 20px;
 background-image: url(list.gif);
 background-repeat: repeat-y;
}
.list1 {
 padding-left: 20px;
}
.file {
 background-image: url(file.gif);
 background-repeat: no-repeat;
 height: 16px;
 cursor: hand;
 padding-left: 32px;
}
.file1 {
 background-image: url(file1.gif);
 background-repeat: no-repeat;
 height: 16px;
 cursor: hand;
 padding-left: 32px;
}
body {
 font-size: 9pt;
 color: #000000;
 background-color: #FFFFFF;
}
a:link {
 font-size: 9pt;
 color: #000000;
 text-decoration: none;
}
a:visited {
 font-size: 9pt;
 color: #000000;
 text-decoration: none;
}
a:hover {
 font-size: 9pt;
 color: #0000FF;
 text-decoration: none;
 position: relative;
 right: 1px;
 bottom: 1px;
}
a:active {
 font-size: 9pt;
 color: #000000;
 text-decoration: none;
}
-->
</style>
</head>
<body>
<a href="/" target="_blank">/</a>提供最新下载《<a href="menu.asp">管理</a>》<br>
<%
menu 0
conn.close
set conn=nothing
%>
</body>
</html>

上一篇:用VB生成DLL封装ASP代码,连接数据库 人气:16873
下一篇:RS.OPEN SQL,CONN,A,B 全接触 人气:46488
浏览全部无限级目录树的内容 Dreamweaver插件下载 网页广告代码 祝你圣诞节快乐 2009年新年快乐