简体   繁体   English

为我的应用程序创建文件扩展名

[英]Creating File Extensions for my application

I'm wondering how I can create my own file extension to work with my application. 我想知道如何创建自己的文件扩展名以与我的应用程序一起使用。 For example, say I wanted to have a ".abc" extension. 例如,假设我想使用“ .abc”扩展名。 The full file name example would be "MyFile.abc". 完整文件名示例将为“ MyFile.abc”。
I want the file to behave in a way that when it is double clicked, it will open up in my application, but actually it contains data of a .xml file. 我希望该文件的行为方式是:双击该文件将在我的应用程序中打开它,但实际上它包含.xml文件的数据。

Sorry if this makes little sense, this is completely new to me. 抱歉,如果这没什么意义,对我来说这是全新的。 I'm using c# in visual studio 2013, and basically my application is an automatic update installer. 我在Visual Studio 2013中使用c#,基本上我的应用程序是自动更新安装程序。 I want it so when my file with my own extension is selected, my application opens and uses the xml data from it to do the update. 我想要它,所以当选择带有自己扩展名的文件时,我的应用程序将打开并使用其中的xml数据进行更新。

You can create your own files with custom extensions by saving the file with that particular extension. 您可以通过保存具有特定扩展名的文件来创建具有自定义扩展名的文件。 Then what you need is to associate the extension with your application. 然后,您需要将扩展​​与您的应用程序关联。 For this you need to create the instance of FileAssociationInfo . 为此,您需要创建FileAssociationInfo的实例。

Check this out System-File-Association 签出系统文件关联

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM