Adobe AIR的执行程序 [英] Adobe AIR to execute program

查看:333
本文介绍了Adobe AIR的执行程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想preSS按钮从Adobe AIR应用程序,并执行一些安装的程序。例如,我将有一个名为启动Winamp的按钮。如果这是pressed应该直接启动Winamp.exe ...我不想要一些命令行执行的事,我只想一个exe启动。还是...是一回事吗?请让我知道这是可能的。

I would like to press a button from an Adobe AIR application and execute some installed program. For example, I would have a button named "Start Winamp". When this is pressed it should start Winamp.exe directly...I don't want some command line thing executed, I only want an exe to start. Or...is it the same thing ? Please, let me know if this is possible.

感谢你。

推荐答案

有这样做的没有直接的方法。尝试<一href="http://www.mikechambers.com/blog/2008/01/17/commandproxy-net-air-integration-proof-of-concept/">CommandProxy.

There's no direct way of doing it. Try CommandProxy.

阅读博客文章非常谨慎。你真的需要创建两个不同的项目:一个本地操作系统的可执行文件和AIR应用程序。本机可执行大火您的AIR应用程序。反过来请求的AIR应用程序的可执行程序来​​处理操作系统级的要求。

Read the blog post very carefully. You really need to create two different projects: a native OS executable and an AIR app. The native executable fires up your AIR application. The AIR application in turn requests for the executable to process OS-level requests.

谷歌code 下载源代码并创建两个项目 - 一个Visual Studio /单声道的示例C#exe文件,另一个 - AIR应用程序。 这里是介绍如何建立一个链接前者。

Download the source from Google Code and create two projects -- a Visual Studio/Mono for the sample C# exe and another -- for the AIR application. Here is a link that describes how to set up the former.

在你的AIR应用程序的主MXML文件,你需要做到以下几点:

In your AIR app's main MXML file, you need to do the following:

  • 创建一个 CommandProxy 对象,添加一些事件监听器,用于连接检测,以及命令响应和错误。

  • Create a CommandProxy object, add a few event listeners, for connection detection, and Command response and error.

通过连接到本机的exe一个连接通话

Connect to the native exe via a connect call

在事件处理程序连接,创建一个新的命令如: ScreenshotCommand 并执行它(通过 CommandProxy.execute 法)

In the event handler for connect, create a new Command e.g. ScreenshotCommand and execute it (via CommandProxy.execute method)

......,这就是它!

... and that's it!

希望这有助于。

这篇关于Adobe AIR的执行程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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