当前位置: 网学 > 编程文档 > ASP > 正文

asp下生成目录树结构的类

来源:Http://myeducs.cn 联系QQ:点击这里给我发消息 作者: 用户投稿 来源: 网络 发布时间: 13/06/16
urrDepth) = objWorkingNode
Else
colNodeStack.Add nCurrDepth, objWorkingNode
End If

Set objWorkingNode = objWorkingNode.CreateChild(szLine)

nCurrDepth = nCurrDepth + 1
ElseIf nNextDepth <= nCurrDepth Then

If nNextDepth > 1 Then

nNextDepth = nNextDepth - 1
While Not colNodeStack.Exists(nNextDepth) And nNextDepth > 1
nNextDepth = nNextDepth - 1
WEnd

Set objWorkingNode = colNodeStack.Item(nNextDepth)
Set objWorkingNode = objWorkingNode.CreateChild(szLine)

nNextDepth = nNextDepth + 1
Else
Set objWorkingNode = CreateChild(szLine)
End If

nCurrDepth = nNextDepth
End If
End If

End If
WEnd

tsObj.Close()
Set tsObj = Nothing
Set fsObj = Nothing

colNodeStack.RemoveAll()
Set colNodeStack = Nothing

End Sub


Public Sub Draw()

AddClientScript()

Response.Write "<div id=""treectrl"" style=""left: " & Left & "px; top: " & Top & "px; position: " & mszPosition & ";"">" & vbCrLf
Response.Write "<form name=""treectrlfrm"" action=""" & Request.ServerVariables("SCRIPT_NAME") & """ method=""get"">" & vbCrLf
Response.Write "<table border=""0"">" & vbCrLf
Response.Write "<tr><td>" & vbCrLf

For Each ChildNode In mcolChildren.Items
ChildNode.Draw()
Next

Response.Write "</td></tr>" & vbCrLf
Response.Write "</table>" & vbCrLf

Response.Write "<input type=""hidden"" name=""togglenode"" value="""">" & vbCrLf
Response.Write "</form>" & vbCrLf
Response.Write "</div>" & vbCrLf

End Sub

Private Sub AddClientScript()
%>
<script language="JavaScript">

function expandNode(szNodeName)
{
if(document.layers != null) {
document.treectrl.document.treectrlfrm.togglenode.value = szNodeName;
document.treectrl.document.treectrlfrm.submit();
}
else {
document.all["treectrlfrm"].togglenode.value = szNodeName;
document.all["treectrlfrm"].submit();
}
}

function collapseNode(szNodeName)
{
if(document.layers != null) {
document.treectrl.document.treectrlfrm.elements[szNodeName].value = -1;
document.treectrl.document.treectrlfrm.submit();
}
else {
document.treectrlfrm.elements[szNodeName].value = -1;
document.treectrlfrm.submit();
}
}

</script>
<%
End Sub

End Class

%>

网学推荐

免费论文

原创论文

浏览:
设为首页 | 加入收藏 | 论文首页 | 论文专题 | 设计下载 | 网学软件 | 论文模板 | 论文资源 | 程序设计 | 关于网学 | 站内搜索 | 网学留言 | 友情链接 | 资料中心
版权所有 QQ:3710167 邮箱:3710167@qq.com 网学网 [Myeducs.cn] 您电脑的分辨率是 像素
Copyright 2008-2015 myeducs.Cn www.myeducs.Cn All Rights Reserved
湘ICP备09003080号