技术资讯

ASP实现的无限级会员树型结构

TIME:2013/1/26

* 函数名称:function nodeuser(parent)
* 函数参数:parent
* 参数类型 :string
* 返回值类型:--
* 函数功能:递归显示用户树型结构
* 作者:范维肖
* 时间:2004-5-7
*********************************
function nodeuser(parent)
检索其分支
sql = "select name from [user] where sel="&parent&""
set rs = conn.execute(sql)
do while not rs.eof
i=i+1
格式控制
for j=i to 2 step -1
response.write("<font color=red>&nbsp;|&nbsp;</font>")
response.write("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;")
next
response.write("<font color=red>&nbsp;|->&nbsp;</font>")
打印出此用户
response.write(rs(0))
response.write("<br>")
递归来显示出此用户为根的树型结构
nodeuser(rs(0))
完毕后转向下一个
rs.movenext
loop
一个级别的显示完成后就缩进一下
i=i-1
rs.close
set rs=nothing
end function

上一篇

广大客户请注意近期网络产品的欺骗行为

下一篇

秦皇岛火锅店点菜系统开发完成