Click here to Skip to main content
15,881,424 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello, i have 2 applications, one version 1.2(i can't change the code here) and the upgrade for it is version 2.0. both can open the same .xml file, are there some changes that can make to crash the program of version 1.2 and to use the the .xml file in version 2.0.

So i do the following thing:
1.i can open the .xml file in version 1.2
2.i can open the same .xml file in version 2.0
3.if i save the .xml file in version 2.0(tags are added to the .xml file) when i save a message appears to inform me that the .xml file cannot be open in version 1.2
4.now if i open it in version 1.2 the file can open and if i save the modification made by 2.0 will be deleted.
5.how can i crash the version 1.2 when I open the .xml file saved from version 2.0

one solution i thought about is to change a type from the project, if a variable is int and i change it to string the version 1.2 will give a message bad .xml file, and in version 2.0 it will open because of the same type in .xml and in the project.

are there any other solutions?

Thanks,
Sas Gabriel
Posted
Updated 1-Feb-12 2:38am
v2

1 solution

read the file, check for value 1.2 or 2.0 and then send the file to appropriate method
 
Share this answer
 
Comments
Gabriel Sas 1-Feb-12 8:42am    
there are 2 versions of program, the .xml should only be open in version 2.0 and not in version 1.2, and also and do not want to change the whole .xml file to only be readable in version 2.0
Herman<T>.Instance 1-Feb-12 13:58pm    
open the file, check the version number and decide to go or stop
Gabriel Sas 1-Feb-12 14:00pm    
there isn't a version number

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900