Public Class chkupdate
Private Countdown As Integer = 0
Private Sub chkupdate_Load_1(sender As Object, e As EventArgs) Handles MyBase.Load
If (Me.Countdown = 0) Then Me.Countdown = 3
Me.Timer1.Interval = 1000
Me.Timer1.Enabled = True
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
Countdown -= 1
If (Countdown <= 0) Then
Dim request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create("https://dl.dropbox.com/s/6ppta6kgv26o6bq/Version.txt?dl=0")
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
Dim frm As New frmLogin
frm.ShowDialog()
Me.Hide()
Else
MsgBox("โปรแกรมได้รับการปรับปรุงใหม่ เมื่อดาวโหลดเสร็จสิ้นกรุณาปิดโปรแกรมก่อนทำการติดตั้งใหม่")
WebBrowser1.Navigate("https://dl.dropbox.com/s/mdxd5b2zhvxwvd1/PoundManagement.exe?dl=0")
End If
End If
End Sub
End Class
Public Class chkupdate
Private Countdown As Integer = 0
Private boolShow As Boolean = False
Private Sub chkupdate_Load_1(sender As Object, e As EventArgs) Handles MyBase.Load
If (Me.Countdown = 0) Then Me.Countdown = 3
Me.Timer1.Interval = 1000
Me.Timer1.Enabled = True
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
Countdown -= 1
If (Countdown <= 0) Then
IF boolShow = False Then
Dim request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create("https://dl.dropbox.com/s/6ppta6kgv26o6bq/Version.txt?dl=0")
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
Dim frm As New frmLogin
frm.ShowDialog()
Me.Hide()
Else
MsgBox("โปรแกรมได้รับการปรับปรุงใหม่ เมื่อดาวโหลดเสร็จสิ้นกรุณาปิดโปรแกรมก่อนทำการติดตั้งใหม่")
WebBrowser1.Navigate("https://dl.dropbox.com/s/mdxd5b2zhvxwvd1/PoundManagement.exe?dl=0")
boolShow = True
End If
End IF
End If
End Sub
End Class