扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
<iewc:TreeView runat="server" ID="Treeview1" NAME="Treeview1">
<iewc:TreeNode id="Treenode1" runat="server" TreeNodeSrc="menuone.txt" Expanded="True" Text="信息类别列表">
</iewc:TreeNode>
</iewc:TreeView>
<TREENODES>
<treenode text='蔬菜' NavigateUrl='xxcb_add.aspx?classname=蔬菜&classid=01'? Target='main1'>
<treenode text='白菜' NavigateUrl='xxcb_add.aspx?classname=白菜&classid=0101'?? Target='main1'/>
<treenode text='萝卜' NavigateUrl='xxcb_add.aspx?classname=萝卜&classid=0102'?? Target='main1'/>
<treenode text='黄花菜' NavigateUrl='xxcb_add.aspx?classname=黄花菜&classid=0103'?? Target='main1'/>
</treenode>
<treenode text='水果' NavigateUrl='xxcb_add.aspx?classname=水果&classid=02'? Target='main1'>
<treenode text='苹果' NavigateUrl='xxcb_add.aspx?classname=苹果&classid=0201'? Target='main1'>
<treenode text='红富士' NavigateUrl='xxcb_add.aspx?classname=红富士&classid=020101'?? Target='main1'/>
<treenode text='其它苹果' NavigateUrl='xxcb_add.aspx?classname=其它苹果&classid=020102'?? Target='main1'/>
</treenode>
<treenode text='桃子' NavigateUrl='xxcb_add.aspx?classname=桃子&classid=0202'?? Target='main1'/>
<treenode text='荔枝' NavigateUrl='xxcb_add.aspx?classname=荔枝&classid=0203'?? Target='main1'/>
</treenode>
<treenode text='粮食' NavigateUrl='xxcb_add.aspx?classname=粮食&classid=03'? Target='main1'>
<treenode text='大米' NavigateUrl='xxcb_add.aspx?classname=大米&classid=0301'?? Target='main1'/>
<treenode text='玉米' NavigateUrl='xxcb_add.aspx?classname=玉米&classid=0302'?? Target='main1'/>
</treenode>
</TREENODES>
Imports System.IO
Dim txtwriter As StreamWriter
txtwriter = File.CreateText(Server.MapPathstrpath ("\menuone.txt"))
txtwriter.WriteLine("<TREENODES>")
Dim objConn As OleDbConnection
Dim objCmd As OleDbCommand
Dim objRead As OleDbDataReader
Dim strSQL, strDSN As String
Dim strid, strname, strid1, strname1 As String
Dim strand As String
strand = "&"
Dim i, j, k, m As Integer
i = 0
j = 0
k = 0
m = 0
strSQL = "select * from class order by classid "
objConn = New OleDbConnection(ConfigurationSettings.AppSettings("connString"))
objCmd = New OleDbCommand(strSQL, objConn)
objCmd.Connection.Open()
objRead = objCmd.ExecuteReader()
While objRead.Read()
If j = 0 Then
j = Len(Trim(objRead.Item("classid")))
Else
strid = strid1
strname = strname1
i = Len(Trim(objRead.Item("classid")))
k = i - j
Select Case k
Case Is > 0
txtwriter.WriteLine("<treenode text='" & strname & "' NavigateUrl='xxcb_add.aspx?classname=" & strname & "" & strand & "classid=" & strid & "' Target='main1'>")
Case Is = 0
txtwriter.WriteLine("<treenode text='" & strname & "' NavigateUrl='xxcb_add.aspx?classname=" & strname & "" & strand & "classid=" & strid & "' Target='main1'/>")
Case Is < 0
txtwriter.WriteLine("<treenode text='" & strname & "' NavigateUrl='xxcb_add.aspx?classname=" & strname & "" & strand & "classid=" & strid & "' Target='main1'/>")
'txtwriter.WriteLine("</treenode>")
m = k
While m < 0
txtwriter.WriteLine("</treenode>")
m = m + 2
End While
End Select
j = Len(Trim(objRead.Item("classid")))
End If
strid1 = Trim(objRead.Item("classid"))
strname1 = Trim(objRead.Item("classname"))
End While
'strid = strid1
'strname = strname1
i = Len(strid)
k = j - i
strid = strid1
strname = strname1
Select Case k
Case Is > 0
txtwriter.WriteLine("<treenode text='" & strname & "' NavigateUrl='xxcb_add.aspx?classname=" & strname & "" & strand & "classid=" & strid & "' Target='main1'/>")
'txtwriter.WriteLine("</treenode>")
m = Len(strid) / 2
While m > 1
txtwriter.WriteLine("</treenode>")
m = m - 1
End While
Case Is = 0
txtwriter.WriteLine("<treenode text='" & strname & "' NavigateUrl='xxcb_add.aspx?classname=" & strname & "" & strand & "classid=" & strid & "' Target='main1'/>")
'txtwriter.WriteLine("</treenode>")
m = Len(strid) / 2
While m > 1
txtwriter.WriteLine("</treenode>")
m = m - 1
End While
Case Is <= 0
txtwriter.WriteLine("<treenode text='" & strname & "' NavigateUrl='xxcb_add.aspx?classname=" & strname & "" & strand & "classid=" & strid & "' Target='main1'/>")
'txtwriter.WriteLine("</treenode>")
m = Len(strid) / 2
While m > 1
txtwriter.WriteLine("</treenode>")
m = m - 1
End While
End Select
txtwriter.WriteLine("</TREENODES>")
txtwriter.Close()
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者