Execute JavaScript from within a C# assembly

后端 未结 6 2126
既然无缘
既然无缘 2021-02-05 07:08

I\'d like to execute JavaScript code from within a C# assembly and have the results of the JavaScript code returned to the calling C# code.

It\'s easier to define things

6条回答
  •  清酒与你
    2021-02-05 07:52

    I don't know of any .NET specific way of doing this right now... Well, there's still JScript.NET, but that probably won't be compatible with whatever JS you need to execute :)

    Obviously the future would be the .NET JScript implementation for the DLR which is coming... someday (hopefully).

    So that probably leaves running the old ActiveX JScript engine, which is certainly possible to do so from .NET (I've done it in the past, though it's a bit on the ugly side!).

提交回复
热议问题