EriX920
Respected
I need someone to write me a fast and clean way of updating my app.
Heres what I wrote in a minute, I just have so much shit to write for my app I can't do it all.
Heres what I wrote in a minute, I just have so much shit to write for my app I can't do it all.
Code:
Private Sub autoup()
Try
My.Computer.Network.DownloadFile("http://www.ecct2.freesteam.org/ecc/version.txt", "version.txt")
Catch ex As Exception
MsgBox(ex)
Exit Sub
End Try
Dim vrspth As String = "version.txt"
Dim vrs As String
Dim objReader As StreamReader
objReader = New StreamReader(vrspth)
vrs = objReader.ReadToEnd()
objReader.Close()
If My.Application.Info.Version.ToString < vrs.ToString Then
MsgBox("Updated available!")
' Do update, maybe call a secondary app to start, close this app
' delete old copy or rename and download new and then start it.
End If
End Sub