MyRss

Imports System.Net
Imports System.IO
Imports System.Threading
Imports System.Xml

Public Class Form
    'MyRSS
    'By: wgscd
    'Date:2005-11-13
    'Contact:wgscd@126.com v
    'QQ;153964481
    Inherits System.Windows.Forms.Form
    Public strRssUrl As String = "http://www.codeproject.com/webservices/articlerss.aspx?cat=6"
#Region " Windows 窗体设计器生成的代码 "

    Public Sub New()
        MyBase.New()

        '该调用是 Windows 窗体设计器所必需的。
        InitializeComponent()

        '在 InitializeComponent() 调用之后添加任何初始化

    End Sub

    '窗体重写 dispose 以清理组件列表。
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Windows 窗体设计器所必需的
    Private components As System.ComponentModel.IContainer

    '注意: 以下过程是 Windows 窗体设计器所必需的
    '可以使用 Windows 窗体设计器修改此过程。
    '不要使用代码编辑器修改它。
    Friend WithEvents Panel2 As System.Windows.Forms.Panel
    Friend WithEvents Splitter2 As System.Windows.Forms.Splitter

    Friend WithEvents ImageList1 As System.Windows.Forms.ImageList
    Friend WithEvents MainMenu1 As System.Windows.Forms.MainMenu
    Friend WithEvents MenuItem1 As System.Windows.Forms.MenuItem
    Friend WithEvents MenuItem2 As System.Windows.Forms.MenuItem
    Friend WithEvents NotifyIcon1 As System.Windows.Forms.NotifyIcon
    Friend WithEvents ToolBar2 As System.Windows.Forms.ToolBar
    Friend WithEvents ToolBarButton3 As System.Windows.Forms.ToolBarButton
    Friend WithEvents ToolBarButton4 As System.Windows.Forms.ToolBarButton
    Friend WithEvents ToolBarButton5 As System.Windows.Forms.ToolBarButton
    Friend WithEvents Panel3 As System.Windows.Forms.Panel
    Friend WithEvents Splitter1 As System.Windows.Forms.Splitter
    Friend WithEvents Panel1 As System.Windows.Forms.Panel
    Friend WithEvents ToolBar1 As System.Windows.Forms.ToolBar
    Friend WithEvents Button1 As System.Windows.Forms.Button
    Friend WithEvents ToolBarButton1 As System.Windows.Forms.ToolBarButton
    Friend WithEvents ToolBarButton2 As System.Windows.Forms.ToolBarButton
    Friend WithEvents ToolBarButton6 As System.Windows.Forms.ToolBarButton
    Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
    Friend WithEvents Panel4 As System.Windows.Forms.Panel
    Friend WithEvents StatusBar1 As System.Windows.Forms.StatusBar
    Friend WithEvents TreeView As System.Windows.Forms.TreeView
    Friend WithEvents StatusBar2 As System.Windows.Forms.StatusBar
    Friend WithEvents WebBrowser As AxSHDocVw.AxWebBrowser
    Friend WithEvents Button2 As System.Windows.Forms.Button
    Friend WithEvents Button3 As System.Windows.Forms.Button
    Friend WithEvents Button4 As System.Windows.Forms.Button
    Friend WithEvents ToolBarButton7 As System.Windows.Forms.ToolBarButton
    Friend WithEvents Button5 As System.Windows.Forms.Button
    Friend WithEvents StatusBarPanel1 As System.Windows.Forms.StatusBarPanel
    Friend WithEvents ListView As System.Windows.Forms.ListView
    Friend WithEvents TabControl1 As System.Windows.Forms.TabControl
    Friend WithEvents TabPage1 As System.Windows.Forms.TabPage
    Friend WithEvents TabPage2 As System.Windows.Forms.TabPage
    Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox
    Friend WithEvents PictureBox2 As System.Windows.Forms.PictureBox


    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container
        Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Form))
        Dim ListViewItem1 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem("sub1")
        Dim ListViewItem2 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem("555")
        Dim ListViewItem3 As System.Windows.Forms.ListViewItem = New System.Windows.Forms.ListViewItem("")
        Me.Panel2 = New System.Windows.Forms.Panel
        Me.TreeView = New System.Windows.Forms.TreeView
        Me.ToolBar2 = New System.Windows.Forms.ToolBar
        Me.ToolBarButton3 = New System.Windows.Forms.ToolBarButton
        Me.ToolBarButton4 = New System.Windows.Forms.ToolBarButton
        Me.ToolBarButton5 = New System.Windows.Forms.ToolBarButton
        Me.ToolBarButton7 = New System.Windows.Forms.ToolBarButton
        Me.StatusBar1 = New System.Windows.Forms.StatusBar
        Me.Splitter2 = New System.Windows.Forms.Splitter
        Me.ImageList1 = New System.Windows.Forms.ImageList(Me.components)
        Me.MainMenu1 = New System.Windows.Forms.MainMenu
        Me.MenuItem1 = New System.Windows.Forms.MenuItem
        Me.MenuItem2 = New System.Windows.Forms.MenuItem
        Me.NotifyIcon1 = New System.Windows.Forms.NotifyIcon(Me.components)
        Me.Panel3 = New System.Windows.Forms.Panel
        Me.TabControl1 = New System.Windows.Forms.TabControl
        Me.TabPage1 = New System.Windows.Forms.TabPage
        Me.PictureBox2 = New System.Windows.Forms.PictureBox
        Me.TabPage2 = New System.Windows.Forms.TabPage
        Me.PictureBox1 = New System.Windows.Forms.PictureBox
        Me.WebBrowser = New AxSHDocVw.AxWebBrowser
        Me.StatusBar2 = New System.Windows.Forms.StatusBar
        Me.StatusBarPanel1 = New System.Windows.Forms.StatusBarPanel
        Me.Panel4 = New System.Windows.Forms.Panel
        Me.Button5 = New System.Windows.Forms.Button
        Me.Button1 = New System.Windows.Forms.Button
        Me.Splitter1 = New System.Windows.Forms.Splitter
        Me.Panel1 = New System.Windows.Forms.Panel
        Me.ListView = New System.Windows.Forms.ListView
        Me.Button4 = New System.Windows.Forms.Button
        Me.Button3 = New System.Windows.Forms.Button
        Me.Button2 = New System.Windows.Forms.Button
        Me.TextBox1 = New System.Windows.Forms.TextBox
        Me.ToolBar1 = New System.Windows.Forms.ToolBar
        Me.ToolBarButton1 = New System.Windows.Forms.ToolBarButton
        Me.ToolBarButton2 = New System.Windows.Forms.ToolBarButton
        Me.ToolBarButton6 = New System.Windows.Forms.ToolBarButton
        Me.Panel2.SuspendLayout()
        Me.Panel3.SuspendLayout()
        Me.TabControl1.SuspendLayout()
        Me.TabPage1.SuspendLayout()
        Me.TabPage2.SuspendLayout()
        CType(Me.WebBrowser, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.StatusBarPanel1, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.Panel4.SuspendLayout()
        Me.Panel1.SuspendLayout()
        Me.SuspendLayout()
        '
        'Panel2
        '
        Me.Panel2.BackColor = System.Drawing.SystemColors.AppWorkspace
        Me.Panel2.Controls.Add(Me.TreeView)
        Me.Panel2.Controls.Add(Me.ToolBar2)
        Me.Panel2.Controls.Add(Me.StatusBar1)
        Me.Panel2.Dock = System.Windows.Forms.DockStyle.Left
        Me.Panel2.Location = New System.Drawing.Point(0, 0)
        Me.Panel2.Name = "Panel2"
        Me.Panel2.Size = New System.Drawing.Size(184, 441)
        Me.Panel2.TabIndex = 2
        '
        'TreeView
        '
        Me.TreeView.Dock = System.Windows.Forms.DockStyle.Fill
        Me.TreeView.ImageIndex = -1
        Me.TreeView.Location = New System.Drawing.Point(0, 41)
        Me.TreeView.Name = "TreeView"
        Me.TreeView.Nodes.AddRange(New System.Windows.Forms.TreeNode() {New System.Windows.Forms.TreeNode("节点0"), New System.Windows.Forms.TreeNode("节点1")})
        Me.TreeView.SelectedImageIndex = -1
        Me.TreeView.Size = New System.Drawing.Size(184, 368)
        Me.TreeView.TabIndex = 14
        '
        'ToolBar2
        '
        Me.ToolBar2.Buttons.AddRange(New System.Windows.Forms.ToolBarButton() {Me.ToolBarButton3, Me.ToolBarButton4, Me.ToolBarButton5, Me.ToolBarButton7})
        Me.ToolBar2.ButtonSize = New System.Drawing.Size(45, 35)
        Me.ToolBar2.DropDownArrows = True
        Me.ToolBar2.Location = New System.Drawing.Point(0, 0)
        Me.ToolBar2.Name = "ToolBar2"
        Me.ToolBar2.ShowToolTips = True
        Me.ToolBar2.Size = New System.Drawing.Size(184, 41)
        Me.ToolBar2.TabIndex = 0
        '
        'ToolBarButton3
        '
        Me.ToolBarButton3.Text = "fdf"
        '
        'StatusBar1
        '
        Me.StatusBar1.Location = New System.Drawing.Point(0, 409)
        Me.StatusBar1.Name = "StatusBar1"
        Me.StatusBar1.Size = New System.Drawing.Size(184, 32)
        Me.StatusBar1.TabIndex = 13
        Me.StatusBar1.Text = "wgscd 2006"
        '
        'Splitter2
        '
        Me.Splitter2.BackColor = System.Drawing.Color.FromArgb(CType(224, Byte), CType(224, Byte), CType(224, Byte))
        Me.Splitter2.Location = New System.Drawing.Point(184, 0)
        Me.Splitter2.Name = "Splitter2"
        Me.Splitter2.Size = New System.Drawing.Size(8, 441)
        Me.Splitter2.TabIndex = 3
        Me.Splitter2.TabStop = False
        '
        'ImageList1
        '
        Me.ImageList1.ImageSize = New System.Drawing.Size(16, 16)
        Me.ImageList1.TransparentColor = System.Drawing.Color.Transparent
        '
        'MainMenu1
        '
        Me.MainMenu1.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem1, Me.MenuItem2})
        '
        'MenuItem1
        '
        Me.MenuItem1.Index = 0
        Me.MenuItem1.Text = "文件"
        '
        'MenuItem2
        '
        Me.MenuItem2.Index = 1
        Me.MenuItem2.Text = "管理"
        '
        'NotifyIcon1
        '
        Me.NotifyIcon1.Text = "NotifyIcon1"
        Me.NotifyIcon1.Visible = True
        '
        'Panel3
        '
        Me.Panel3.BackColor = System.Drawing.SystemColors.AppWorkspace
        Me.Panel3.Controls.Add(Me.TabControl1)
        Me.Panel3.Controls.Add(Me.WebBrowser)
        Me.Panel3.Controls.Add(Me.StatusBar2)
        Me.Panel3.Controls.Add(Me.Panel4)
        Me.Panel3.Dock = System.Windows.Forms.DockStyle.Bottom
        Me.Panel3.Location = New System.Drawing.Point(192, 257)
        Me.Panel3.Name = "Panel3"
        Me.Panel3.Size = New System.Drawing.Size(688, 184)
        Me.Panel3.TabIndex = 8
        '
        'TabControl1
        '
        Me.TabControl1.Controls.Add(Me.TabPage1)
        Me.TabControl1.Controls.Add(Me.TabPage2)
        Me.TabControl1.Location = New System.Drawing.Point(24, 40)
        Me.TabControl1.Name = "TabControl1"
        Me.TabControl1.SelectedIndex = 0
        Me.TabControl1.Size = New System.Drawing.Size(344, 104)
        Me.TabControl1.TabIndex = 4
        '
        'TabPage1
        '
        Me.TabPage1.Controls.Add(Me.PictureBox2)
        Me.TabPage1.Location = New System.Drawing.Point(4, 21)
        Me.TabPage1.Name = "TabPage1"
        Me.TabPage1.Size = New System.Drawing.Size(336, 79)
        Me.TabPage1.TabIndex = 0
        Me.TabPage1.Text = "TabPage1"
        '
        'PictureBox2
        '
        Me.PictureBox2.Location = New System.Drawing.Point(16, 16)
        Me.PictureBox2.Name = "PictureBox2"
        Me.PictureBox2.TabIndex = 0
        Me.PictureBox2.TabStop = False
        '
        'TabPage2
        '
        Me.TabPage2.Controls.Add(Me.PictureBox1)
        Me.TabPage2.Location = New System.Drawing.Point(4, 21)
        Me.TabPage2.Name = "TabPage2"
        Me.TabPage2.Size = New System.Drawing.Size(336, 79)
        Me.TabPage2.TabIndex = 1
        Me.TabPage2.Text = "TabPage2"
        '
        'PictureBox1
        '
        Me.PictureBox1.Location = New System.Drawing.Point(72, 16)
        Me.PictureBox1.Name = "PictureBox1"
        Me.PictureBox1.TabIndex = 0
        Me.PictureBox1.TabStop = False
        '
        'WebBrowser
        '
        Me.WebBrowser.ContainingControl = Me
        Me.WebBrowser.Dock = System.Windows.Forms.DockStyle.Fill
        Me.WebBrowser.Enabled = True
        Me.WebBrowser.Location = New System.Drawing.Point(0, 32)
        Me.WebBrowser.OcxState = CType(resources.GetObject("WebBrowser.OcxState"), System.Windows.Forms.AxHost.State)
        Me.WebBrowser.Size = New System.Drawing.Size(688, 120)
        Me.WebBrowser.TabIndex = 3
        '
        'StatusBar2
        '
        Me.StatusBar2.Location = New System.Drawing.Point(0, 152)
        Me.StatusBar2.Name = "StatusBar2"
        Me.StatusBar2.Panels.AddRange(New System.Windows.Forms.StatusBarPanel() {Me.StatusBarPanel1})
        Me.StatusBar2.Size = New System.Drawing.Size(688, 32)
        Me.StatusBar2.TabIndex = 2
        Me.StatusBar2.Text = "就绪"
        '
        'StatusBarPanel1
        '
        Me.StatusBarPanel1.Text = "StatusBarPanel1"
        '
        'Panel4
        '
        Me.Panel4.BackColor = System.Drawing.SystemColors.Control
        Me.Panel4.Controls.Add(Me.Button5)
        Me.Panel4.Controls.Add(Me.Button1)
        Me.Panel4.Dock = System.Windows.Forms.DockStyle.Top
        Me.Panel4.Location = New System.Drawing.Point(0, 0)
        Me.Panel4.Name = "Panel4"
        Me.Panel4.Size = New System.Drawing.Size(688, 32)
        Me.Panel4.TabIndex = 1
        '
        'Button5
        '
        Me.Button5.Location = New System.Drawing.Point(8, 0)
        Me.Button5.Name = "Button5"
        Me.Button5.TabIndex = 0
        Me.Button5.Text = "关闭"
        '
        'Button1
        '
        Me.Button1.BackColor = System.Drawing.Color.Silver
        Me.Button1.FlatStyle = System.Windows.Forms.FlatStyle.System
        Me.Button1.Location = New System.Drawing.Point(136, 8)
        Me.Button1.Name = "Button1"
        Me.Button1.TabIndex = 1
        Me.Button1.Text = "Button1"
        '
        'Splitter1
        '
        Me.Splitter1.BackColor = System.Drawing.SystemColors.ControlDarkDark
        Me.Splitter1.Dock = System.Windows.Forms.DockStyle.Bottom
        Me.Splitter1.Location = New System.Drawing.Point(192, 249)
        Me.Splitter1.Name = "Splitter1"
        Me.Splitter1.Size = New System.Drawing.Size(688, 8)
        Me.Splitter1.TabIndex = 9
        Me.Splitter1.TabStop = False
        '
        'Panel1
        '
        Me.Panel1.BackColor = System.Drawing.Color.RosyBrown
        Me.Panel1.Controls.Add(Me.ListView)
        Me.Panel1.Controls.Add(Me.Button4)
        Me.Panel1.Controls.Add(Me.Button3)
        Me.Panel1.Controls.Add(Me.Button2)
        Me.Panel1.Controls.Add(Me.TextBox1)
        Me.Panel1.Controls.Add(Me.ToolBar1)
        Me.Panel1.Dock = System.Windows.Forms.DockStyle.Fill
        Me.Panel1.ForeColor = System.Drawing.SystemColors.ControlDark
        Me.Panel1.Location = New System.Drawing.Point(192, 0)
        Me.Panel1.Name = "Panel1"
        Me.Panel1.Size = New System.Drawing.Size(688, 249)
        Me.Panel1.TabIndex = 10
        '
        'ListView
        '
        Me.ListView.AccessibleDescription = "ghgfjgfj"
        Me.ListView.Dock = System.Windows.Forms.DockStyle.Fill
        Me.ListView.GridLines = True
        Me.ListView.Items.AddRange(New System.Windows.Forms.ListViewItem() {ListViewItem1, ListViewItem2, ListViewItem3})
        Me.ListView.Location = New System.Drawing.Point(0, 50)
        Me.ListView.Name = "ListView"
        Me.ListView.Size = New System.Drawing.Size(688, 199)
        Me.ListView.TabIndex = 6
        Me.ListView.View = System.Windows.Forms.View.List
        '
        'Button4
        '
        Me.Button4.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.Button4.BackColor = System.Drawing.Color.Silver
        Me.Button4.FlatStyle = System.Windows.Forms.FlatStyle.System
        Me.Button4.Location = New System.Drawing.Point(632, 16)
        Me.Button4.Name = "Button4"
        Me.Button4.Size = New System.Drawing.Size(40, 23)
        Me.Button4.TabIndex = 5
        Me.Button4.Text = "Button4"
        '
        'Button3
        '
        Me.Button3.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.Button3.BackColor = System.Drawing.Color.Silver
        Me.Button3.FlatStyle = System.Windows.Forms.FlatStyle.System
        Me.Button3.Location = New System.Drawing.Point(592, 16)
        Me.Button3.Name = "Button3"
        Me.Button3.Size = New System.Drawing.Size(32, 23)
        Me.Button3.TabIndex = 4
        Me.Button3.Text = "Button3"
        '
        'Button2
        '
        Me.Button2.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.Button2.BackColor = System.Drawing.SystemColors.Window
        Me.Button2.FlatStyle = System.Windows.Forms.FlatStyle.Flat
        Me.Button2.Location = New System.Drawing.Point(520, 16)
        Me.Button2.Name = "Button2"
        Me.Button2.Size = New System.Drawing.Size(48, 23)
        Me.Button2.TabIndex = 3
        Me.Button2.Text = "Button2"
        '
        'TextBox1
        '
        Me.TextBox1.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
                    Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.TextBox1.Location = New System.Drawing.Point(208, 16)
        Me.TextBox1.Name = "TextBox1"
        Me.TextBox1.Size = New System.Drawing.Size(296, 21)
        Me.TextBox1.TabIndex = 2
        Me.TextBox1.Text = "TextBox1"
        '
        'ToolBar1
        '
        Me.ToolBar1.Buttons.AddRange(New System.Windows.Forms.ToolBarButton() {Me.ToolBarButton1, Me.ToolBarButton2, Me.ToolBarButton6})
        Me.ToolBar1.ButtonSize = New System.Drawing.Size(64, 44)
        Me.ToolBar1.DropDownArrows = True
        Me.ToolBar1.Location = New System.Drawing.Point(0, 0)
        Me.ToolBar1.Name = "ToolBar1"
        Me.ToolBar1.ShowToolTips = True
        Me.ToolBar1.Size = New System.Drawing.Size(688, 50)
        Me.ToolBar1.TabIndex = 0
        '
        'ToolBarButton2
        '
        Me.ToolBarButton2.Text = "rtrt"
        Me.ToolBarButton2.ToolTipText = "rt"
        '
        'Form
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
        Me.ClientSize = New System.Drawing.Size(880, 441)
        Me.Controls.Add(Me.Panel1)
        Me.Controls.Add(Me.Splitter1)
        Me.Controls.Add(Me.Panel3)
        Me.Controls.Add(Me.Splitter2)
        Me.Controls.Add(Me.Panel2)
        Me.Menu = Me.MainMenu1
        Me.Name = "Form"
        Me.Panel2.ResumeLayout(False)
        Me.Panel3.ResumeLayout(False)
        Me.TabControl1.ResumeLayout(False)
        Me.TabPage1.ResumeLayout(False)
        Me.TabPage2.ResumeLayout(False)
        CType(Me.WebBrowser, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.StatusBarPanel1, System.ComponentModel.ISupportInitialize).EndInit()
        Me.Panel4.ResumeLayout(False)
        Me.Panel1.ResumeLayout(False)
        Me.ResumeLayout(False)

    End Sub

#End Region
    Dim MyRSSchannel As String = "config/channels.xml"

    Private Sub Form_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        WebBrowser.StatusBar = True
        ListView.Columns.Add("新闻标题", 133, HorizontalAlignment.Center)
        ListView.Columns.Add("取回时间", 93, HorizontalAlignment.Center)
        Dim Node As TreeNode

 


        With TreeView
            .ExpandAll()

 

            ''  .Nodes.AddRange(Node)
        End With


        With ListView
            .View = View.Details

            For i As Integer = 0 To 44

                .Items.Add("wgscd" & i)

            Next

 

 


        End With

 

 

 

 

 

 

 


        If getRssFile() = True Then

            loadXML(strpath)
        Else


            Dim httpReq As HttpWebRequest = HttpWebRequest.Create(strRssUrl)
            Dim httpRes As HttpWebResponse = httpReq.GetResponse
            Dim oStreamR As New StreamReader(httpRes.GetResponseStream)
            Dim str As String = ""
            MsgBox(oStreamR.ReadToEnd)

        End If

 

    End Sub
    Function getRssFile() As Boolean

        Dim f As New FileInfo(MyRSSchannel)

        If f.Exists Then

            Return True
        Else
            Return False
        End If

    End Function

    Sub getList()

 

    End Sub

    Dim strPath As String = "//groups/group/name"
    Dim subPath As String = "//groups/group/name/group/name"

    Sub loadXML(ByVal strXpath As String)
        Dim xmlDoc As New XmlDocument
        Dim myXMLreader As XmlReader
        Dim myXMLwriter As XmlWriter
        Dim xmlNodeR As XmlNodeReader


        xmlDoc.Load(MyRSSchannel)
        Dim xmlNode As XmlNode '' = xmlDoc.SelectSingleNode(strXpath)
        Dim xmlNodes As XmlNodeList = xmlDoc.SelectNodes(strXpath)
        Dim subTitle As XmlNodeList = xmlDoc.SelectNodes(subPath)

        Dim o As String = "wgscd"

        For i As Integer = 0 To xmlNodes.Count - 1

            Me.TreeView.Nodes.Add((xmlNodes.Item(i).InnerXml))
            ''MsgBox(xmlNodes.Item(i).ChildNodes.Count)
            MsgBox(subTitle.Count)

 

            For j As Integer = 0 To subTitle.Count - 1

                Me.TreeView.Nodes.Item(i).Nodes.Add((subTitle.Item(i).InnerXml))

 


            Next

            For j As Integer = 0 To xmlNodes(i).ChildNodes.Count - 1

                ''Me.TreeView.Nodes.Item(i).Nodes.Add(xmlNodes(j).ChildNodes(j).InnerXml)

            Next


        Next


        If xmlDoc.HasChildNodes Then


            ''  MsgBox(xmlDoc.Value)

        End If

 


        TreeView.ExpandAll()


    End Sub

 

    Dim x As XmlDocument
    Dim r As XmlReader
    Dim w As XmlWriter
    Dim n As XmlNode
    Dim ns As XmlNodeList
    Function readfile(ByVal node As String) As XmlNode
        x.Load("config/channel.xml")
        ns = x.SelectNodes("/" & node)
        Dim nr As XmlNodeReader
        For i As Integer = 0 To ns.Count - 1
            Me.TreeView.Nodes.Add(ns.Item(node).InnerXml)


        Next

 


    End Function

 


    '功能:取得元素值
    '参数:node--节点 element--元素名
    '返回:元素值 字符型
    ' $--表示出错误
    Public Function GetElement(ByVal node As String, ByVal element As String) As String

        ''  Dim mXmlNode As System.Xml.XmlNode = mXmlDoc.SelectSingleNode("//" + node)

        '读数据
        ''  Dim xmlNode As System.Xml.XmlNode = mXmlNode.SelectSingleNode(element)
        '' Return xmlNode.InnerText.ToString

    End Function
    '
    '功能:保存元素值
    '参数:node--节点名称 element--元素名 val--值
    '返回:True--保存成功 False--保存失败
    Public Function SaveElement(ByVal node As String, ByVal element As String, ByVal val As String) As Boolean

        ''  Dim mXmlNode As System.Xml.XmlNode = mXmlDoc.SelectSingleNode("//" + node)
        Dim xmlNodeNew As System.Xml.XmlNode

        ''   xmlNodeNew = mXmlNode.SelectSingleNode(element)
        xmlNodeNew.InnerText = val
        ''   mXmlDoc.Save(MyClass.XmlFile)
        Return True
    End Function

 

 

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        ''WebBrowser.Navigate2("http://sina.com")
        TabControl1.TabPages.Add(New TabPage)
        TabControl1.TabPages.Clear()

 

    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

    End Sub

    Private Sub TreeView_Select(ByVal sender As System.Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles TreeView.AfterSelect

        ' MsgBox(e.Node.TreeView.SelectedNode.Text)
        MsgBox(CType(sender, TreeView).SelectedNode.Tag)

    End Sub

 

    Private Sub WebBrowser_DownloadBegin(ByVal sender As Object, ByVal e As System.EventArgs) Handles WebBrowser.DownloadBegin


        StatusBar2.Text = "正在打开"

 

 

    End Sub

    Private Sub WebBrowser_DownloadComplete(ByVal sender As Object, ByVal e As System.EventArgs) Handles WebBrowser.DownloadComplete
        StatusBar2.Text = " 完成"
    End Sub

 

 


    Private Sub ListView_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListView.SelectedIndexChanged


        '   Me.Text = DirectCast(sender, ListView).FocusedItem.Text

 

    End Sub

    Private Sub ListView_ItemCheck(ByVal sender As Object, ByVal e As System.Windows.Forms.ItemCheckEventArgs) Handles ListView.ItemCheck
        '  MsgBox(e.CurrentValue)

        '  MsgBox(CType(sender, TreeView).SelectedNode.Tag)

 


    End Sub


    Private Sub ListView_ColumnClick(ByVal sender As Object, ByVal e As System.Windows.Forms.ColumnClickEventArgs) Handles ListView.ColumnClick
        '' MsgBox(e.Column().ToString())
    End Sub

    Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click

    End Sub

    Private Sub TabPage2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TabPage2.Click
        ''TabControl1.TabPages.Remove(DirectCast(sender, TabPage))
        '' MsgBox(DirectCast(sender, TabPage).Text)
    End Sub

    Private Sub Panel4_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Panel4.Paint

    End Sub
End Class


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值