创建具有自定义文件扩展名的新文件?
如何创建文件格式为 .kuy 的新文件。该文件将保存加密数据。然后我可以选择扩展名为 .kuy 的文件进行解密。因此,如果我加密了 soundfile.aup,加密的文件将为 soundfile.aup.kuy,然后用户将继续解密该文件,在这种情况下,输出将为 soundfile.aup。
谢谢你,
鲍比
How can I create a new file with a file format of say .kuy.This file would be holding encrypted data. And then later I could choose that file with extension .kuy to decrypt. So if I encrypted soundfile.aup, the encrypted file would be soundfile.aup.kuy, then the user would proceed to decrypting that file in which case the output would be soundfile.aup.
Thank you,
Bobby
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以通过转到 Target 的信息窗口并选择“属性”选项卡来为应用程序分配文件扩展名:
之后也就是说,您只需在保存文件时添加所需的扩展名即可。
You can assign a file extension to your application by going to your Target's info window and selecting the Properties tab:
After that, you just need to add your desired extension when you save a file.
正如史蒂夫建议的那样,首先您必须创建自定义文件格式。之后,每当打开自定义文件时(双击或其他任何方式),其路径将被传递到 application:openFile:。 http://developer.apple.com/library/mac/documentation/Cocoa/Reference/NSApplicationDelegate_Protocol/Reference/Reference.html#//apple_ref/doc/uid/TP40008592-CH1-SW29
一旦你找到了路径,按照你的逻辑去做,你应该没问题。
As Steve suggests, first you have to create a custom file format. After that, whenever a custom file gets open - double click or whatever - its path will be passed to application:openFile:. http://developer.apple.com/library/mac/documentation/Cocoa/Reference/NSApplicationDelegate_Protocol/Reference/Reference.html#//apple_ref/doc/uid/TP40008592-CH1-SW29
Once you have the path, do your logic and you should be fine.