开发者

Best way to use javascript api for a desktop app

i have a desktop application and i really want to use some APIs that a开发者_Python百科re only available in their Javascript version.... (Waze API/Google Earth API), my question ... what is the best way if you think its possbile and worth it to perform this bridge between my C# desktop app with this javascript API ?


You can execute JScript from C#. Add a reference to Microsoft.JScript and use something like this:

using Microsoft.JScript;
object result = Microsoft.JScript.Eval.JScriptEvaluate("my javascript code", Microsoft.JScript.Vsa.VsaEngine.CreateEngine());


javascript is not adapted for desktop applications. You could use a WebBrowser to embed some web page widget which will execute the javascript.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜