Results 1 to 6 of 6

Thread: [RESOLVED] Search-Compare-Update Files

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2011
    Posts
    13

    Resolved [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
    Code:
    1.0.0
    ex. the server versions are:
    Code:
    1.0.0 
    1.1.0
    2.0.0
    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


  2. #2
    PowerPoster
    Join Date
    Mar 2002
    Location
    UK
    Posts
    4,780

    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.

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2011
    Posts
    13

    Re: Search-Compare-Update Files

    Could you give me a piece of code?
    Because ive never used this before.

  4. #4
    Fanatic Member Arve K.'s Avatar
    Join Date
    Sep 2008
    Location
    Kyrksæterøra, Norway
    Posts
    518

    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...
    Arve K.

    Please mark your thread as resolved and add reputation to those who helped you solve your problem
    Disclaimer: I am not a professional programmer

  5. #5

    Thread Starter
    New Member
    Join Date
    Aug 2011
    Posts
    13

    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.

  6. #6

    Thread Starter
    New Member
    Join Date
    Aug 2011
    Posts
    13

    Re: Search-Compare-Update Files

    bump

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width