Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
190 views
in Technique[技术] by (71.8m points)

c# - 将JavaScript引擎嵌入.NET [关闭](Embedding JavaScript engine into .NET [closed])

just wondering if anyone has ever tried embedding and actually integrating any js engine into the .net environment.(只是想知道是否有人尝试嵌入并实际将任何js引擎集成到.net环境中。)

I could find and actually use (after a LOT of pain and effort, since it's pretty outdated and not quite finished) spidermonkey-dotnet project.(我可以找到并实际使用(经过很多痛苦和努力,因为它已经过时而且还没完成)spidermonkey-dotnet项目。) Anyone with experience in this area?(有这方面经验的人吗?) Engines like SquirrelFish, V8..(发动机如SquirrelFish,V8 ..) Not that I'm not satisfied with Mozilla's Spidermonkey (using it for Rails-like miniframework for custom components inside the core ASP.NET application), but I'd still love to explore a bit further with the options.(并不是说我对Mozilla的Spidermonkey不满意(将它用于核心ASP.NET应用程序中的自定义组件的Rails式miniframework),但我仍然喜欢进一步探索这些选项。) The command-line solutions are not what I'd need, I cannot rely on anything else than CLR, I need to call methods from/to JavaScript/C# objects.(命令行解决方案不是我需要的,我不能依赖CLR以外的任何东西,我需要从/到JavaScript / C#对象调用方法。) // c# class public class A { public string Hello(string msg) { return msg + " whatewer"; } } // js snippet var a = new A(); console.log(a.Hello('Call me')); // i have a console.log implemented, don't worry, it's not a client-side code :) Just to clarify - I'm not trying to actually program the application itself in server-side javascript.(只是为了澄清 - 我不是试图在服务器端javascript中实际编写应用程序本身 。) It's used solely for writing custom user subapplications (can be seen as some sort of DSL).(它仅用于编写自定义用户子应用程序(可以看作某种DSL)。) It's much easier (and safer) to allow normal people programming in js than C#.(允许普通人在js中编程比C#更容易(也更安全)。)   ask by community wiki translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Try Javascript .NET .(试试Javascript .NET 。)

It is hosted on GitHub It was originally hosted on CodePlex, here )(它托管在GitHub上它最初托管在CodePlex上, 在这里 )) Project discussions: http://javascriptdotnet.codeplex.com/discussions(项目讨论: http//javascriptdotnet.codeplex.com/discussions) It implements Google V8.(它实现了Google V8。) You can compile and run JavaScript directly from .NET code with it, and supply CLI objects to be used by the JavaScript code as well.(您可以直接从.NET代码编译和运行JavaScript,并提供JavaScript代码以供JavaScript代码使用。) It generates native code from JavaScript.(它从JavaScript生成本机代码。)

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...