C#/.NET 脚本库

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1067784/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 07:26:28  来源:igfitidea点击:

C#/.NET scripting library

c#.netscripting

提问by ulrichb

I want to enhance an application with scripting support like many other applications have, e.g. MS Office using VBAor UltraEdit using JavaScript.

我想像许多其他应用程序一样使用脚本支持来增强应用程序,例如使用 VBA 的 MS Office使用 JavaScript 的 UltraEdit

Which libraries do exist for C#/.NET (and which language(s) do they support)?

C#/.NET 有哪些库(以及它们支持哪些语言)?

采纳答案by gimel

IronPythonis a dynamic .NETscripting language.

IronPython是一种动态.NET脚本语言。

IronPython is an implementation of the Python programming language running under .NET and Silverlight. It supports an interactive console with fully dynamic compilation. It's well integrated with the rest of the .NET Framework and makes all .NET libraries easily available to Python programmers, while maintaining compatibility with the Python language.

IronPython 是在 .NET 和 Silverlight 下运行的 Python 编程语言的实现。它支持具有完全动态编译的交互式控制台。它与 .NET Framework 的其余部分很好地集成在一起,使 Python 程序员可以轻松使用所有 .NET 库,同时保持与 Python 语言的兼容性。

See IronPython embeddingfor examples showing ways to call IronPython from .NETapps. The IronPython Calculator and the Evaluatorgoes into the details of using IronPythonfrom a C#application.

有关显示从应用程序调用 IronPython 的方法的示例,请参阅IronPython 嵌入.NET。该IronPython的计算器和计算器进入使用的细节IronPython从一个C#应用程序。

回答by Matthew Scharley

Lua is often touted as being one of the better ones... Try looking at this other question for more information: What are the most effective ways to use Lua with C#?

Lua 经常被吹捧为更好的方法之一......尝试查看另一个问题以获取更多信息:在 C# 中使用 Lua 的最有效方法是什么?

Also:

还:

回答by TheVillageIdiot

Please check CS Scriptinglibrary

请检查CS 脚本

Hereis an article about scripting Photoshop CS with C#

是一篇关于使用 C# 编写 Photoshop CS 脚本的文章

Thisone discusses using LUA as scripting lib with C#.

这个讨论了使用 LUA 作为 C# 的脚本库。

回答by maxwellb

Don't forget LSharp, LISP in .NET. Something to keep an eye on if you are exploring functionality stage. Maybe Rob Blackwell will be glad to hear you're considering it.

不要忘记LSharp,.NET 中的 LISP。如果您正在探索功能阶段,请注意一些事项。也许罗布布莱克威尔会很高兴听到你正在考虑它。

回答by lukebuehler

You can bake your own scripting environment with Mono.CSharp (just one simple dll) or Roslyn, both are getting quite mature now.

您可以使用 Mono.CSharp(只是一个简单的 dll)或 Roslyn 烘焙您自己的脚本环境,两者现在都变得相当成熟。

Mono contains the Evaluatorclass and Roslyn the ScriptEngine, both make it a breeze setting up a script environment. Of course something like ScriptCSalready builds on that (Roslyn) and gives you more features.

Mono 包含Evaluator类和 Roslyn ScriptEngine,两者都使设置脚本环境变得轻而易举。当然,像ScriptCS这样的东西已经建立在 (Roslyn) 之上,并为您提供更多功能。

For an C# script environment built on Mono.CSharp you can check out CShell(which I made).

对于基于 Mono.CSharp 构建的 C# 脚本环境,您可以查看CShell(我制作的)。

回答by Jonathan Wood

Depending on your needs, the SILKlibrary might be a good option.

根据您的需要,SILK库可能是一个不错的选择。

It's an easy to use interpreter. The interpreted language is not C#. It's a custom language that was designed to be easy to use (very little punctuation, not case sensitive, etc.) But it does support functions.

这是一个易于使用的解释器。解释型语言不是 C#。这是一种易于使用的自定义语言(很少标点符号,不区分大小写等)但它确实支持函数。

Built-in functions are handled via events. That is, when the interpreted code calls one of your internal functions, it raises an event in your program.

内置函数通过事件处理。也就是说,当解释的代码调用您的内部函数之一时,它会在您的程序中引发一个事件。