starcraft Posted July 30, 2003 Posted July 30, 2003 how do i compair 2 .txt files and if there the same then do nothing but if 1.txt number is higher then 2.txt then do nothing but it 2.txt is higher then copy files. I'm tring to build an updater for my program. And i have all of it done but the compairing of the 2 versions files. Quote
*Experts* mutant Posted July 30, 2003 *Experts* Posted July 30, 2003 If you want to check the current version and compare it then you dont need to store it in the file, you can access it by: Application.ProductVersion But if you do it this way be sure to update the AssemblyInfo file with the current version, version info is on the bottom of the file if you use the vs.net generated AssemblyInfo file. AssebmlyInfo file is automatically generated by VS.NET when creating a project. With this you can read the file with the newest version and then compare the result of the reading with Application.ProductVersion. Quote
*Experts* mutant Posted July 30, 2003 *Experts* Posted July 30, 2003 Lets say this is how you read the file with the version, im assuming its only one line long and there is only version info there: Dim reader As New IO.StreamReader("path to the version file") dim currentversion as string = reader.ReadLine() If currentversion = Application.ProductVersion Then 'current version on the client is the same as the newest one Else 'version is not the same, needs update End If And also this is assuming that you write the file file the client downloaded using Application.ProductVersion so they have the same format. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.