VB.Net程序设计:AutoUpdater软件自动更新-源代码

前端之家收集整理的这篇文章主要介绍了VB.Net程序设计:AutoUpdater软件自动更新-源代码前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

VB.Net程序设计:AutoUpdater软件自动更新-源代码

界面和配置文件参考:

http://blog.csdn.net/linjimu/archive/2009/10/27/4733283.aspx

XmlFiles.vb

Imports System
Imports System.IO
Imports System.Xml

Public Class XmlFiles
    Inherits XmlDocument

    Private _xmlFileName As String

    Public Property XmlFileName() As String
        Get
            Return _xmlFileName
        End Get
        Set(ByVal value As String)
            _xmlFileName = value
        End Set
    End Property

    Public Sub New(ByVal xmlFile As String)
        XmlFileName = xmlFile
        Me.Load(XmlFileName)
    End Sub

    '''<summary> 
    '''给定一个节点的xPath表达式并返回一个节点 
    '''</summary> 
    '''<param name="xPath"></param> 
    '''<returns></returns> 
    Public Function FindNode(ByVal xPath As String) As XmlNode
        Dim xmlNode As XmlNode = Me.SelectSingleNode(xPath)
        Return xmlNode
    End Function

    '''<summary> 
    '''给定一个节点的xPath表达式返回其值 
    '''</summary> 
    '''<param name="xPath"></param> 
    '''<returns></returns> 
    Public Function GetNodeValue(ByVal xPath As String) As String
        Dim xmlNode As XmlNode = Me.SelectSingleNode(xPath)
        Return xmlNode.InnerText
    End Function

    '''<summary> 
    '''给定一个节点的表达式返回此节点下的孩子节点列表 
    '''</summary> 
    '''<param name="xPath"></param> 
    '''<returns></returns> 
    Public Function GetNodeList(ByVal xPath As String) As XmlNodeList
        Dim nodeList As XmlNodeList = Me.SelectSingleNode(xPath).ChildNodes
        Return nodeList
    End Function

End Class


DownloadFileInfo.vb


Public Class DownloadFileInfo

    Private m_fileName As String = ""
    Private m_lastver As String = ""

    Public Property FileName() As String
        Get
            Return m_fileName
        End Get
        Set(ByVal value As String)
            m_fileName = value
        End Set
    End Property

    Public Property LastVer() As String
        Get
            Return m_lastver
        End Get
        Set(ByVal value As String)
            m_lastver = value
        End Set
    End Property

    Public Sub New(ByVal fname As String,ByVal fver As String)
        Me.m_fileName = fname
        Me.m_lastver = fver
    End Sub

End Class
原文链接:/vb/262311.html

猜你在找的VB相关文章