I am making a complex program hopefully to be released in the near future. (Intentionally evasive) In my program I have a 'check for updates' menu tab that opens a new form. On this form i have a single button, which when pressed downloads a text file from the server.
This code has no errors as I can see it just doesn't do what i want...
Code:
Private Sub WebClient_DownloadFileCompleted(ByVal sender As Object, ByVal e As System.ComponentModel.AsyncCompletedEventArgs) Handles WebClient.DownloadFileCompleted
MsgBox("Checking complete")
readit.Text = My.Computer.FileSystem.ReadAllText("Version.txt")
If readit.Text.Length > 7 Then
Downloadfile("https://www.MyServer.com\Version.txt")
Exit Sub
End If
Dim updatedVersion As Double = Val(readit.Text)
Dim currentVersion As Double = Val(Application.ProductVersion)
UVer.Text = readit.Text
If updatedversion > currentversion Then
MsgBox("New Update Avalible!")
System.Diagnostics.Process.Start("https://www.UpdateSite.com")
Else
MsgBox("No Updates Avalible")
End If
End Sub
When the code is done,
currentVersion = 1.0 , where in the project assembly it is 1.0.0.0
updatedVersion = 5.0 , where in the text file it is 5.0.0.0
Am I using the wrong variable type? I want the,
Code:
If updatedversion > currentversion Then
MsgBox("New Update Avalible!")
System.Diagnostics.Process.Start("https://www.UpdateSite.com")
Else
MsgBox("No Updates Avalible")
End If
To compare the whole number not just the first 3 characters....
Thnx