Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Timer1.Enabled = True
End Sub
Public Sub CheckForUpdates()
Dim request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create("http://dl.dropbox.com/u/67540394/Program/Erotic%20Production/Update.txt")
Dim response As System.Net.HttpWebResponse = request.GetResponse()
Dim sr As System.IO.StreamReader = New System.IO.StreamReader(response.GetResponseStream())
Dim newestversion As String = sr.ReadToEnd()
Dim currentversion As String = Application.ProductVersion
If newestversion.Contains(currentversion) Then
MsgBox("You are up todate :D")
Label1.Text = "เวอร์ชั่นล่าสุด"
Label1.ForeColor = Color.Green
Button1.Enabled = True
Else
If MsgBox("A New Version 'xxx.exe updatenow", MsgBoxStyle.YesNo, "") = MsgBoxResult.Yes Then
System.Diagnostics.Process.Start(" xxx.exe << ตรงนี้ัยังไม่ได้ใส่ครับอยากให้มันแทนที่ตัวEXeเก่า ")
End If
End If
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Button1.Enabled = False
Timer1.Enabled = False
CheckForUpdates()
End Sub
End Class