我打算在Xamarin应用中使用javascript传感器融合库-可能还会在手表项目中使用。在我的网络标准库中,我有:
Ahrs文件包含:
public class Ahrs
{
static ScriptEngine engine = new ScriptEngine();
static FileScriptSource fileScript = new FileScriptSource("./index.js"); // <-- invalid file path
public static double Run()
{ // file notfound
engine.Evaluate(fileScript);
return engine.CallGlobalFunction<double>("update", 0, 0, 0, 1, 1, 1);
}
}
...我尝试在update
文件中使用js
调用方法Jurassic的位置>
有什么方法可以将index.js
文件添加到我的网络标准库中,然后从Ahrs
文件中的所有文件中运行它?
我打算在Xamarin应用中使用javascript传感器融合库-可能还会在手表项目中使用。在我的网络标准库中,我具有:Ahrs文件包含:公共类Ahrs {...
[如果我使用路径"index.js"
而不是"./index.js"
,似乎对我有用
public class Ahrs
{
static ScriptEngine engine = new ScriptEngine();
static FileScriptSource fileScript = new FileScriptSource("index.js"); // <-- invalid file path
public static double Run()
{ // file notfound
engine.Evaluate(fileScript);
return engine.CallGlobalFunction<double>("update", 0, 0, 0, 1, 1, 1);
}
}