创建自己的文件扩展名 [英] Creating Own File Extension Name

查看:158
本文介绍了创建自己的文件扩展名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在vb.net中创建自己的文件扩展名.

How to create own file extension in vb.net.

which is open in a unique application.

推荐答案

在此CodeProject文章中对此进行了解释:
VB.NET中的文件关联 [
至于打开"文件之类的操作;这是您需要在应用程序中编码的东西.命令行管理程序仅在命令行中以您在注册表中指定的格式为您提供文件名.可能很简单
This is explained in this CodeProject article:
File Association in VB.NET[^].

I think the article is not perfect, but you only need to learn what is prescribed in the system registry to provide the Shell the required information on your newly introduced "file type" and its association with the application you need to run to work with the files recognized as the files of your type.

As to the operations like "open" the file; this is something you need to code in your application. The Shell only gives you the file name in a command line in a format you prescribe in the Registry. It could be as simple as
MyApplication.EXE myDataFileName.NewFileType

或类似

MyApplication.EXE /c /d -verbose /input:myDataFileName.NewFileType -no_warning /log:logfile.txt


您的应用程序应解析命令行并采取相应措施.

您可以使用我在文章中提供的命令行实用程序:
基于枚举的命令行实用程序 [System.Environment.CommandLine,请参阅:
http://msdn.microsoft.com/en-us/library/system.environment. commandline.aspx [ ^ ].

—SA


Your application should parse the command line and act accordingly.

You can use the command line utility I offer in my article:
Enumeration-based Command Line Utility[^].

You can also do it by yourself, because the command line is passed to your applications in a couple of ways: 1) as two parameters passed to the entry point method (usually "Main"), 2) as the property System.Environment.CommandLine, please see:
http://msdn.microsoft.com/en-us/library/system.environment.commandline.aspx[^].

—SA


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

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