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

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

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

界面和配置文件参考:

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

XmlFiles.vb

  1. Imports System
  2. Imports System.IO
  3. Imports System.Xml
  4.  
  5. Public Class XmlFiles
  6. Inherits XmlDocument
  7.  
  8. Private _xmlFileName As String
  9.  
  10. Public Property XmlFileName() As String
  11. Get
  12. Return _xmlFileName
  13. End Get
  14. Set(ByVal value As String)
  15. _xmlFileName = value
  16. End Set
  17. End Property
  18.  
  19. Public Sub New(ByVal xmlFile As String)
  20. XmlFileName = xmlFile
  21. Me.Load(XmlFileName)
  22. End Sub
  23.  
  24. '''<summary>
  25. '''给定一个节点的xPath表达式并返回一个节点
  26. '''</summary>
  27. '''<param name="xPath"></param>
  28. '''<returns></returns>
  29. Public Function FindNode(ByVal xPath As String) As XmlNode
  30. Dim xmlNode As XmlNode = Me.SelectSingleNode(xPath)
  31. Return xmlNode
  32. End Function
  33.  
  34. '''<summary>
  35. '''给定一个节点的xPath表达式返回其值
  36. '''</summary>
  37. '''<param name="xPath"></param>
  38. '''<returns></returns>
  39. Public Function GetNodeValue(ByVal xPath As String) As String
  40. Dim xmlNode As XmlNode = Me.SelectSingleNode(xPath)
  41. Return xmlNode.InnerText
  42. End Function
  43.  
  44. '''<summary>
  45. '''给定一个节点的表达式返回此节点下的孩子节点列表
  46. '''</summary>
  47. '''<param name="xPath"></param>
  48. '''<returns></returns>
  49. Public Function GetNodeList(ByVal xPath As String) As XmlNodeList
  50. Dim nodeList As XmlNodeList = Me.SelectSingleNode(xPath).ChildNodes
  51. Return nodeList
  52. End Function
  53.  
  54. End Class


DownloadFileInfo.vb


  1. Public Class DownloadFileInfo
  2.  
  3. Private m_fileName As String = ""
  4. Private m_lastver As String = ""
  5.  
  6. Public Property FileName() As String
  7. Get
  8. Return m_fileName
  9. End Get
  10. Set(ByVal value As String)
  11. m_fileName = value
  12. End Set
  13. End Property
  14.  
  15. Public Property LastVer() As String
  16. Get
  17. Return m_lastver
  18. End Get
  19. Set(ByVal value As String)
  20. m_lastver = value
  21. End Set
  22. End Property
  23.  
  24. Public Sub New(ByVal fname As String,ByVal fver As String)
  25. Me.m_fileName = fname
  26. Me.m_lastver = fver
  27. End Sub
  28.  
  29. End Class

猜你在找的VB相关文章