Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/logging/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Adobe AIR NativeProcess Hello World_Air - Fatal编程技术网

Adobe AIR NativeProcess Hello World

Adobe AIR NativeProcess Hello World,air,Air,我有 extendedDesktop 在my Application.xml文件中,但以下内容会产生此错误: 错误#1034:类型强制失败:无法转换闪存。文件系统::File@619de81到flash.desktop.NativeProcessStartupInfo <supportedProfiles>extendedDesktop</supportedProfiles> 新AdobeAIR项目 函数Init(){ var myAIRFile=new air.F

我有

extendedDesktop
在my Application.xml文件中,但以下内容会产生此错误:

错误#1034:类型强制失败:无法转换闪存。文件系统::File@619de81到flash.desktop.NativeProcessStartupInfo

<supportedProfiles>extendedDesktop</supportedProfiles>

新AdobeAIR项目
函数Init(){
var myAIRFile=new air.File('C:/Program Files(x86)/Windows NT/Accessories/Wordpad.exe');
var myProcess=new air.NativeProcess();
var myStartup=new air.NativeProcessStartupInfo();
myStartup.executable=myAIRFile;
myProcess.start(myAIRFile);
}

该代码看起来像HTML代码,这意味着您正在创建一个Web应用程序

NativeProcess仅适用于桌面上的应用程序。 不适用于网络应用程序

谢谢 ,

Neeraj

该代码看起来像HTML代码,这意味着您正在创建一个Web应用程序

NativeProcess仅适用于桌面上的应用程序。 不适用于网络应用程序

谢谢 ,

Neeraj

只需在它所属的地方使用myStartup即可:

<html>
<head>
<title>New Adobe AIR Project</title>
<script type="text/javascript" src="lib/air/AIRAliases.js"></script>
<script type="text/javascript" src="lib/air/AIRIntrospector.js"></script>
<script type="text/javascript" src="lib/jquery/jquery-1.4.2.js"></script>
<script>
function Init(){
    var myAIRFile = new air.File('C:/Program Files (x86)/Windows NT/Accessories/Wordpad.exe');
    var myProcess = new air.NativeProcess();
    var myStartup = new air.NativeProcessStartupInfo();
    myStartup.executable = myAIRFile;
    myProcess.start(myAIRFile);

}
</script>
</head>
<body onload="Init();">
</body>
</html>

只需在myStartup所属的位置使用它:

<html>
<head>
<title>New Adobe AIR Project</title>
<script type="text/javascript" src="lib/air/AIRAliases.js"></script>
<script type="text/javascript" src="lib/air/AIRIntrospector.js"></script>
<script type="text/javascript" src="lib/jquery/jquery-1.4.2.js"></script>
<script>
function Init(){
    var myAIRFile = new air.File('C:/Program Files (x86)/Windows NT/Accessories/Wordpad.exe');
    var myProcess = new air.NativeProcess();
    var myStartup = new air.NativeProcessStartupInfo();
    myStartup.executable = myAIRFile;
    myProcess.start(myAIRFile);

}
</script>
</head>
<body onload="Init();">
</body>
</html>

@皮奥特雷科斯基,你为什么不给我解释一下!AIR应用程序是桌面软件,而不是网页。只需谷歌AIR而不必问。@Piotrekokski我希望你懂英语。因为这正是我所说的AIR nativeprocess适用于台式机,共享的代码片段是HTML。@Piotrekokski你为什么不给我解释一下!AIR应用程序是桌面软件,而不是网页。只需谷歌AIR而不必问。@Piotrekokonski我希望你懂英语。因为这正是我所说的AIR nativeprocess适用于台式机,共享的代码片段是HTML。