xml文件到我自己的类型文件? [英] Xml file to my own type file?

查看:69
本文介绍了xml文件到我自己的类型文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的程序中,我将一些数据保存在xml文件中,但是许多程序可以打开该文件
我只需要通过程序打开xml文件

感谢我的帮助.

In my program i save some data in xml file but this file can open by many program
i need to make xml file open only by program

Thanks for help me

推荐答案

您可以考虑加密(而不是更改文件格式)(例如,请参见CodeProject上的文章: [
Instead of changing file format, you may consider encryption (see, for instance, here at CodeProject the article: "Simple encrypting and decrypting data in C#"[^]) for protecting your data.


我建​​议您忽略此问题.有什么不好的呢?如果您只想打开由程序创建的文件,则可以做一个简单的事情:使用不同的类型命名;例如,使用文件扩展名"(谢天谢地,没有真正的文件扩展名了,所以这只是文件名的结尾),例如".myApplication"(当然要选择一个明智的字符串,但以点'开头'.'')将其注册为要在您的应用程序中打开的新文件类型".完成此操作后,默认情况下,命令行管理程序将用您的应用程序打开以此方式命名的文件.

知道如何使用Windows的任何人都可以手动执行它,并且在许多网站(包括CodeProject)中都有足够的有关如何以编程方式执行Windows的说明.

—SA
I would recommend just to ignore this problem. What''s so bad about it? If all you want is to be able to open your files created by your program only by your program, do a simple thing: use different type naming; for example, use file "extension" (there are no true file extensions anymore, thanks goodness, so this is just the end of file names), such as ".myApplication" (pick a sensible string of course, but starting with dot ''.''). Register this as a new "file type" to be opened with your application. After you do this, the Shell will open files named in this way with your application by default.

Anyone who knows how to use Windows can do it manually, and there are enough instructions on how to do it programmatically in many Web sites, including CodeProject.

—SA


顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶
顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶


这篇关于xml文件到我自己的类型文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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