【发布时间】:2011-06-03 14:39:03
【问题描述】:
如果我在参数中添加空格,我会在运行 NativeProcess 时遇到问题
if (Capabilities.os.toLowerCase().indexOf("win") > -1)
{
fPath = "C:\\Windows\\System32\\cmd.exe";
args.push("/c");
args.push(scriptDir.resolvePath("helloworld.bat").nativePath);
}
file = new File(fPath);
var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
nativeProcessStartupInfo.executable = file;
args.push("blah");
nativeProcessStartupInfo.arguments = args;
process = new NativeProcess();
process.start(nativeProcessStartupInfo);
在上面的代码中,如果我使用
args.push("blah")一切正常
如果我使用
args.push("blah blah") 程序中断,就好像找不到 文件。
好像不止我一个:
http://tech.groups.yahoo.com/group/flexcoders/message/159521
正如其中一位用户所指出的,这似乎是 21 世纪尖端 SDK 的一个可怕限制。甚至 Alex Harui 也没有答案,而且众所周知,他可以解决每个 Adobe 错误:)
有什么想法吗?
【问题讨论】:
-
您使用的是哪个版本。我正在使用最新版本,并且参数中的空格没有任何问题。你在使用 var args =new air.Vector["
"]();初始化参数 -
是的,Pradeep,我使用的是 Vector 但不是 air.Vector,我在 air 包中没有任何 Vector。我相信 Vector 在顶级包中。另外,我使用的是最新的 FB 4.5。
-
我问的是Adobe AIR版本,我的是2.6
标签: air