im trying to write an updater for my program and im checking the version by downloading a .txt file. however its coming out blank. this is the first time ive done something like this so i probably noobed something bad. any ideas?
Code:Private Sub checkVersion() Dim strDir As String = "" Dim strUrl, strCurVersion, strVersion As String Dim sr As IO.StreamReader getDirectory(strDir) Form2.Show() Form2.lblProg.Text = "Checking Version" Form2.Prog.Value = 10 'Download version If My.Computer.FileSystem.FileExists(strDir + "\CurrentVersion.txt") Then My.Computer.FileSystem.DeleteFile(strDir + "\CurrentVersion.txt") End If My.Computer.Network.DownloadFile("http://www.mediafire.com/file/1323y9ws5n9eosg/KIG_Version.txt", strDir + "\CurrentVersion.txt") 'Load current version sr = IO.File.OpenText(strDir + "\CurrentVersion.txt") strCurVersion = sr.ReadLine() strUrl = sr.ReadLine() sr.Close() 'Load old version If My.Computer.FileSystem.DirectoryExists(strDir + "\Version.txt") Then sr = IO.File.OpenText(strDir + "\Version.txt") strVersion = sr.ReadLine() sr.Close() Else strVersion = "0" End If 'Compare If strCurVersion = strVersion Then Form2.lblProg.Text = "No update is available" Else updateVersion(strUrl, strCurVersion, strVersion) End If Form2.lblProg.Text = "Launching Keep it Green" Form2.Prog.Value = 100 runVersion(strCurVersion) End Sub




Reply With Quote