|
-
Aug 10th, 2011, 02:21 PM
#1
Thread Starter
New Member
[RESOLVED] Search-Compare-Update Files
Hello!
I have a little problem with coding a version check for my auto-updater.
The problem is:
I got a current version stored in update.ini localy.
The server has a file version.txt with the current and past versions.
lets say
ex. my local version is
ex. the server versions are:
I want the program to search the local version in the server file, check if there are newer versions, download the corresponding file, update the config.ini witht the newer version (it should be 1.1.0 now) and repeat until it reaches the highest version available.
I can do everything else, but i just cant figure out how to perform his check.
So if anyone could help me with this I would really appreciate it!
here is a picture to show you what i mean
-
Aug 10th, 2011, 02:28 PM
#2
Re: Search-Compare-Update Files
.Net has a Version object, which you can use to compare against other Version objects. Extract the data into a list of version and then sort it, you can then iterate through it processing each one as you need.
-
Aug 10th, 2011, 03:27 PM
#3
Thread Starter
New Member
Re: Search-Compare-Update Files
Could you give me a piece of code?
Because ive never used this before.
-
Aug 10th, 2011, 07:31 PM
#4
Re: Search-Compare-Update Files
Have a look at the link in my signature. The code there works kind of the same way as yours, and it also have an example on how to use the Version class...
-
Aug 11th, 2011, 04:07 AM
#5
Thread Starter
New Member
Re: Search-Compare-Update Files
Yes i checked your code and i saw that it checks all the lines...
Is there any way i can adapt it so it will check only one value in the other file and then 'do something?
Or is there any way just to search localfileversion in onlinefile and when line is found, it gets the value of the one line below
Cheers
Last edited by uroshercog; Aug 11th, 2011 at 05:09 AM.
-
Aug 12th, 2011, 08:07 AM
#6
Thread Starter
New Member
Re: Search-Compare-Update Files
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|