Hi..
I am using DropBox to Update My Application. I have created a share link of file "CurrentVersion.txt".
My Code reads the text from the file and check against the current version. And if there is an new version , the Latest.exe is downloaded.
What i have noticed is, if the "CurrentVersion.txt" Contains only "1.0.0.0" then i am getting the error, and if there is anything else in the file say even "1.0.0.1", then no error is displayed.
I have noticed the same behaviour when creating a link to this particular file. If it contains "1.0.0.0" then i get an message as "You don’t have permission to create a link to this file". And if the file contains something apart from "1.0.0.0" the link is created.
My Code
Try
Dim request As HttpWebRequest = CType(WebRequest.Create("https://www.dropbox.com/s/ym194ty8lrifzhw/NewVersion.txt?dl=1"), HttpWebRequest)
Dim Response As HttpWebResponse = CType(request.GetResponse(), HttpWebResponse)
Dim Sr As IO.StreamReader = New IO.StreamReader(Response.GetResponseStream)
Dim NewVersion As String = Sr.ReadToEnd
Dim CurrentVersion As String = Application.ProductVersion
If NewVersion <> CurrentVersion Then
MessageBox.Show("New Version Exists", MsgboxHeader, MessageBoxButtons.OK, MessageBoxIcon.Information)
Else
MessageBox.Show("No Updates Found", MsgboxHeader, MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
Catch ex As Exception
MessageBox.Show("An Error Occurred while trying to Check for Update" & vbCrLf & vbCrLf & "Error Details:" & vbCrLf & ex.Message, MsgboxHeader, MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try