自定义文件类型和图标

自定义文件类型和图标

本文介绍了自定义文件类型和图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用java编写的游戏,它具有保存游戏的功能并加载所有使用.txt文件的功能但是我觉得如果我有自己的文件类型会很酷......我知道我可以将它设置为保存为尚未定义的类型,但后来我得到一个文件的空白图标...有没有办法可以在java中为它提供自定义文件图标?我看过网上等等,但我找到的只是微软网站在c#和vb等中解释其中一些......

I have a game I'm writing in java, it has the functionality to save games and load them all working with .txt files but I thought it would be cool if I could have my own file type...I know I can just set it to save as a type that isn't already defined but then I get a blank icon for the file...is there a way I can give it a custom file icon in java? I've looked online etc but all I find is the microsoft website explaining some of it in c# and vb etc...

推荐答案

我想如果您在Windows中创建了文件类型,只要您在Windows中,就可以将文件类型添加到系统中。然后去查看现有的文件类型。现在将您的图标与该类型相关联。

I would think if you created the filetype in windows, provided you are in Windows, you can add the file type to the system. then go view existing file types. Now associate your icon to that type.

以下是在Windows中的操作方法:

Here is how to do it in Windows:

在以前版本的Windows中,这可以在资源管理器中。 Google很容易找到。

in previous versions of windows this can be in Explorer. Google around easy find.

现在添加了类型后,请执行以下操作:

Now once you have added the type, do this:

这只会在你的机器上执行此操作,如果你需要部署它,并希望这种方式在另一台机器上,这应该给你足够的使用像InstallShield一样编写脚本。如果你告诉我你要部署的安装程序,我甚至可以提供一个脚本。

This will only do this on your machine, if you need to deploy this, and want this on another machine this way, this should give you enough to work with to script it out with like InstallShield. If you tell me the installer you will be deploying, I can even provide a script.

这篇关于自定义文件类型和图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-14 10:02