AIR 2.0及以上提供了非常简单易用的API让你使用操作系统所定义的关联应用程序打开文件. 这使得使用AIR开发基于“文件管理器”的应用称为可能 用法如下: var file:File = File.desktopDirectory.resolvePath("test.txt");//桌面上的一个txt文件 file.openWithDefaultApplication();…
摘要:      File类提供了一个方法openWithDefaultApplication可以用本地默认应用程序打开指定路径下的文件. 当我用下面语句的时候,可以成功打开桌面文件夹下面的文件: var file:File = File.desktopDirectory.resolvePath("test.jpg") 但是,要打开的文件一般都是放在安装目录下的.当然,file也为我们提供了相关的API: 当我这样调用的时候,报错了 Error: Error #3000: Illega…
Qt提供了QDesktopServices类, 可以利用openUrl函数调用默认程序打开文件: 源码参考: #ifdef Q_OS_WIN32 m_szHelpDoc = QString("file:///") + m_szHelpDoc; bool is_open = QDesktopServices::openUrl(QUrl(m_szHelpDoc, QUrl::TolerantMode)); if(!is_open) { LogWriter::getLogCenter()-&…
如果文件已被指定默认程序 open httpd.conf 指定一个特定程序打开文件 # 用 sublime text 打开 httpd.conf open -a /Applications/Sublime\ Text.app/ httpd.conf 如果使用频繁,还可以添加软连接 sudo ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/bin/sublime 输入sublime就可以打开 su…
如何设置eclipse在默认模式下打开文件 打开eclipse.选择例如以下:windows --> preferences --> General --> Editors --> file Associations 假设列表中没有.能够点击ADD加入文件的格式. 然后在以下加入默认打开的此格式文件的应用就可以,例如以下图: 版权声明:本文博客原创文章,博客,未经同意,不得转载.…
前几天从网上下了个图像分析的mfc小程序,是VC6的 用VC6在本地编译生成都没问题.执行起来弹出一个未处理的错误,程序崩溃退出. 想起来原来遇到过打开文件对话框方面的问题,当时项目时间紧张未能深究. 这次要好好看下这个问题. 详细做法就是深入仔细的跟踪.跟踪.跟踪. .. 应用代码,跟进 MFC的代码,跟进 Alt+8调出反汇编,跟进. . . 重复多次重复追踪.缩小目标.确定问题是:在CFileDialog 的析构函数中,调用了CString 的析构函数, 恰恰是析构CSring 出错了.…
1.自己的APP调用第三方打开文件 主要是使用  UIDocumentInteractionController  类   并实现 UIDocumentInteractionControllerDelegate 的代理方法 @interface HNDownFileViewController ()<UIDocumentInteractionControllerDelegate> @property (nonatomic, strong) UIDocumentInteractionContro…
以保存文件为例 首先,在项目中加入ContinuationManager.cs类,以及SuspensionManager.cs类. 其次,在App.xaml.cs中,完成如下步骤: 1. 添加ContinuationManager类的实例作为属性. public ContinuationManager ContinuationManager { get; private set; } 2. 加入如下的方法 // for continuable private Frame CreateRootFr…
当我用下面语句的时候,可以成功打开桌面文件夹下面的文件: var file:File = File.desktopDirectory.resolvePath("test.jpg") 但是,要打开的文件一般都是放在安装目录下的.当然,file也为我们提供了相关的API: 当我这样调用的时候,报错了 Error: Error #3000: Illegal path name.at Error$/throwError() at flash.filesystem::File/openWithD…
windows上可以使用os.startfile os.startfile(file) linux上可以使用xdg-open subprocess.call(["xdg-open", file]) mac os上可以使用open subprocess.call(["open", file])…