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