Odigo
Gawd
- Joined
- Apr 22, 2002
- Messages
- 805
I have a small application that I want to compare a local text file to a server's text file for updates and display a message saying an update is available. Code help appreciated
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
First, read this: http://hardforum.com/showthread.php?t=810619
So, unless you post what you have so far, I doubt you'll get much help.
What about adding a version number in the first line of the txt file and compare that. If it's greater, then it is a newer version.
Like Ur Mom said, use your noggin first and ask specific questions that you need help with.
We can't figure out how to help you if you don't tell us what you've tried so far. If you're asking us for help without having tried to write it, you shouldn't be surprised when people here aren't in the mood to be helpful.I thought I just did? I need to know how to check a local text file and compare a value with one that is not local. I'm looking for code examples, as I'm new to programming and I don't know how to go about doing this. Seeing as my responses thus far have not been any help whatsoever, it's pretty apparent I came to the wrong place.
Different is not the same as newer. What if the local file is newer? The same flaw exists in that Youtube code.I don't know vb so I can't help with code, but easiest way would be to download the file, then read both files char by char at the same time (ex: have two separate streams open and just read a char from both in a loop), if you hit a single instance where both chars are different, then just stop and return true, otherwise keep going until you reach end of file, and return false. (true = new update, false = none).
Different is not the same as newer. What if the local file is newer? The same flaw exists in that Youtube code.