打开.xml文件时如何崩溃程序 [英] how to crash a program when i open a .xml file

查看:121
本文介绍了打开.xml文件时如何崩溃程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我有2个应用程序,一个是1.2版(我在这里不能更改代码),其升级版本是2.0版.两者都可以打开相同的.xml文件,是否可以进行某些更改以使版本1.2的程序崩溃并在版本2.0中使用.xml文件.

所以我做了以下事情:
1.i可以在1.2版中打开.xml文件
2.i可以在2.0版中打开相同的.xml文件
3.如果我将.xml文件保存在2.0版中(将标签添加到.xml文件中),则在保存时出现一条消息,通知我.xml文件无法在1.2版中打开
4.now如果我在版本1.2中打开它,则文件可以打开,如果我保存由2.0所做的修改,则将被删除.
5.打开从版本2.0保存的.xml文件时,如何使版本1.2崩溃?

我想到的一个解决方案是从项目中更改类型,如果变量为int,而我将其更改为字符串,则版本1.2将给出错误的.xml文件消息,而在版本2.0中,它将因相同的类型而打开.xml和项目中.

还有其他解决方案吗?

谢谢,
Sas Gabriel

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

推荐答案

读取文件,检查值1.2或2.0,然后将文件发送到适当的方法
read the file, check for value 1.2 or 2.0 and then send the file to appropriate method


这篇关于打开.xml文件时如何崩溃程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆