用另一个文件打开我的C#应用​​程序(由我的应用程序创建) [英] Opening my C# Application with another file (created by my application)

查看:129
本文介绍了用另一个文件打开我的C#应用​​程序(由我的应用程序创建)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我有一个应用程序,我要将某些对象的当前状态保存到文件中,然后我希望该应用程序将该文件与我的应用程序关联,以便当我双击该文件时,我的应用程序将打开并读取信息从该文件恢复状态.

目前,我只是使用XmlSerializer来序列化包装对象并将其保存到我的HDD上的xml文件中.

关于如何使用创建的文件打开我的应用程序的任何建议?

抱歉,我在C#环境中还很陌生,我不确定如何搜索类似的内容.

谢谢

Hi there,

I have an application where i want to save the current state of some objects to a file and then i want the application that file to be assosiated with my application so that when i double click on that file, my app will open and read the info from that file to retore the state.

Currently i''m simply using the XmlSerializer to serialize a wrapper object and save it to a xml file on my HDD.

Any suggestions as to how i would be able to use that created file to open my app?

Sorry, i''m pretty new in the c# environment and I''m not sure how to search for something like this.

Thanks

推荐答案

OK :)
尝试更改您的输出扩展名
从.XML到例如.YourAppSettings
并通过Explorer将新扩展名与您的应用程序关联:)
OK :)
Try to change your output extension
from .XML to, for example, .YourAppSettings
and associate the new extension with your application by Explorer :)


您可以使用快捷方式
使用XML文件作为参数来启动您的应用...:)
You could use a shortcut
to start your app with an XML file as parameter... :)


非常感谢,它现在可以为我提供帮助,但是我无法为我保存的每个会话执行此操作-最终会有很多.
我希望该应用程序像Word文档一样工作,例如,您在其中打开.doc文件并打开MS Word.我将创建自己的文件扩展名,例如* .pop
Thanks alot it can help me for now but i cant do that for every session i save - eventually there will be many.
I want the app to work like a word doc, for example, where you open the .doc file and it opens MS Word. I will create my own file extension e.g. *.pop


这篇关于用另一个文件打开我的C#应用​​程序(由我的应用程序创建)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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