'下面代码为显示目录树最关键的函数,使用了递归方法(很多象这样类型的都是用递归来做的。) function listChild(id) dim sRec,sSql,sNum,sTmp set sRec=server.createobject("adodb.recordset") sSql="select listId,listName,listInfo,parentId from listTable where parentId=" & id sRec.open sSql,sConn,3,1 if not sRec.eof then sNum=1 response.write("<table width='100%' border='0' cellspacing='0' cellpadding='0'>" & chr(13)) while not sRec.eof sTmp=sConn.execute("select count(listId) as countSub from listTable where parentId=" & sRec("listId")) if sTmp("countSub")>0 then response.write("<tr>" & chr(13)) if sNum=sRec.recordcount then response.write("<td width='18' valign='top'><img src='images/angel.gif'></td>" & chr(13)) else response.write("<td width='18' background='images/eline.gif' valign='top'><img src='../../images/t.gif' ></td>" & chr(13)) end if response.write("<td>" & chr(13) & "<table width='100%' border='0' cellspacing='0' cellpadding='0'>" & chr(13)) response.write("<tr>" & chr(13) & "<td width='118' class='menuPro' id='listName"