Вопрос

I develop an AIR application. I want when I press the open button it open the text file with notepad++ which I specify as ("C:\Program Files\Notepad++\notepad++.exe") or with any other application I provide. Also Can I specify the command line arguments for application. Thanks

Это было полезно?

Решение

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);          
        }

This is how I did it. May be it help others. Thanks

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top