开发者

Best way to use javascript api for a desktop app

开发者 https://www.devze.com 2023-02-10 06:19 出处:网络
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),

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

精彩评论

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