1

我开发了一个 AIR 应用程序。我希望当我按下打开按钮时,它会使用我指定为 ("C:\Program Files\Notepad++\notepad++.exe") 或我提供的任何其他应用程序的 notepad++ 打开文本文件。我也可以为应用程序指定命令行参数吗?谢谢

4

1 回答 1

2
if(NativeProcess.isSupported)
        {
          var npsi:NativeProcessStartupInfo = new NativeProcessStartupInfo();
          var file:File = new File("Appication to launch");
          npsi.executable = file;

          var args:Vector.<String> = new Vector.<String>();
          args[0] = "File that is being open with application";

          args[1] = "Additonal argument if any";

          npsi.arguments = args;
          var process:NativeProcess = new NativeProcess();
          process.start(npsi);          
        }

我就是这样做的。可能是帮助别人。谢谢

于 2013-03-27T12:52:35.163 回答