我构建了一个使用 nativeProcess 来打开 exe 的应用程序。
Flex Builder 3 中的应用程序运行没有错误。
然后,当我将应用程序 AIR 导出为 .air 并将应用程序安装到开发人员电脑或其他电脑中时,问题就出现了。
当我按下按钮打开 .exe 时,出现消息“不支持 native 进程”。
我使用的 main.mxml 中的代码:
if (NativeProcess.isSupported)
{
var file:File = new File("app:/config/AbrirAplicacion.exe");
var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
nativeProcessStartupInfo.executable = file;
process = new NativeProcess();
process.start(nativeProcessStartupInfo);
process.standardInput.writeUTFBytes(textReceived.text+"\n");
process.addEventListener(ProgressEvent.STANDARD_OUTPUT_DATA, onOutputData);
process.addEventListener(ProgressEvent.STANDARD_INPUT_PROGRESS, inputProgressListener);
}
else
{
textReceived.text = "NativeProcess not supported.";
}
对我做错了什么有什么想法吗?
最佳答案
NativeProcess 仅在应用程序编译为 native 二进制文件(而非 .air 安装程序)时可用。
关于apache-flex - AIR 2.0 NativeProcess 不受支持问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3138672/