Question

I've got a small problem that consists in following: In my C# application, I have a function named MakeBackup() which as it says, makes the backup copy of a txt file in my case. My application also saves some information in a file called settings.txt, so when I launch my application, it checks if this file exists, if yes, it asks you to make a backup. Let's assume that the user has got already the settings.txt file, the application will try to make the backup of that file, and then it will save it's own settings.txt file. So, my question is, how can I distinguish the generated settings.txt file by my application from the user settings.txt file? The names are equal, but not the content. But comparing the content of both files is not the solution I'm looking for.

I'll try to explain more: let's say the app generates it's own settings.txt, every time I launch the program, it asks me to do a backup, but I'd like to do the backup ONLY with the user settings.txt file, but not the one generated from the program.

Was it helpful?

Solution

I'm a little unclear, but if you don't want to change file names then I'd suggest either putting the backup file in a subfolder, named after the date, or having the backup in the application folder and have previous version in subfolders named after the date.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top