Keep a backup of a file, and detect changes when opened

Do you need something made? then ask in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
8 posts Page 1 of 1
Contributors
User avatar
zachman61
VIP - Donator
VIP - Donator
Posts: 1892
Joined: Wed Dec 16, 2009 9:56 pm

For example:
If you save a file and then close the program then edit it with Notepad++ or another text editor then reload the program and i want to be able to detect it was modified from what it was when the program was closed

Also the file type is a .ini
Nailing my feet to the floor is easier than using my own muscles to balance, but you don't see me doing that :)
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

You could either compare part of the file data, or you could compare the last date it was modified.
User avatar
zachman61
VIP - Donator
VIP - Donator
Posts: 1892
Joined: Wed Dec 16, 2009 9:56 pm

Well how would i save it as a backup inside the program?
or a better method of saving the data would be suffice.
Nailing my feet to the floor is easier than using my own muscles to balance, but you don't see me doing that :)
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

If it has to be within the program, you could append the data to a list of byte arrays.
User avatar
zachman61
VIP - Donator
VIP - Donator
Posts: 1892
Joined: Wed Dec 16, 2009 9:56 pm

I'd like it to be either encrypted .ini file or hidden within the program.
Nailing my feet to the floor is easier than using my own muscles to balance, but you don't see me doing that :)
User avatar
MrAksel
C# Coder
C# Coder
Posts: 1758
Joined: Fri Mar 26, 2010 12:27 pm

You could also use the FileSystemWatcher to detect changes. To storee the data you could use a byte array as mandai said.
LMAOSHMSFOAIDMT
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;


Over 30 projects with source code!
Please give reputation to helpful members!

Image
Image
User avatar
zachman61
VIP - Donator
VIP - Donator
Posts: 1892
Joined: Wed Dec 16, 2009 9:56 pm

Would it be easier to use a hidden folder and read the data from the hidden folder?
Nailing my feet to the floor is easier than using my own muscles to balance, but you don't see me doing that :)
User avatar
MrAksel
C# Coder
C# Coder
Posts: 1758
Joined: Fri Mar 26, 2010 12:27 pm

Well you would still need to store the data when you read it...
LMAOSHMSFOAIDMT
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;


Over 30 projects with source code!
Please give reputation to helpful members!

Image
Image
8 posts Page 1 of 1
Return to “Tutorial Requests”