简体   繁体   English

C#/.NET 脚本库

[英]C#/.NET scripting library

I want to enhance an application with scripting support like many other applications have, eg MS Office using VBA or UltraEdit using JavaScript .我想像许多其他应用程序一样使用脚本支持来增强应用程序,例如使用 VBA 的 MS Office使用 JavaScript 的 UltraEdit

Which libraries do exist for C#/.NET (and which language(s) do they support)? C#/.NET 有哪些库(以及它们支持哪些语言)?

Please check CS Scripting library请检查CS 脚本

Here is an article about scripting Photoshop CS with C#是一篇关于使用 C# 编写 Photoshop CS 脚本的文章

This one discusses using LUA as scripting lib with C#. 这个讨论了使用 LUA 作为 C# 的脚本库。

IronPython is a dynamic .NET scripting language. IronPython是一种动态的.NET脚本语言。

IronPython is an implementation of the Python programming language running under .NET and Silverlight. IronPython 是在 .NET 和 Silverlight 下运行的 Python 编程语言的实现。 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.它与 .NET Framework 的其余部分很好地集成在一起,使 Python 程序员可以轻松使用所有 .NET 库,同时保持与 Python 语言的兼容性。

See IronPython embedding for examples showing ways to call IronPython from .NET apps.有关显示从.NET应用程序调用 IronPython 的方法的示例,请参阅IronPython 嵌入 The IronPython Calculator and the Evaluator goes into the details of using IronPython from a C# application.IronPython 计算器和评估器详细介绍了从C#应用程序使用IronPython的细节。

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:还:

Don't forget LSharp , LISP in .NET.不要忘记LSharp ,.NET 中的 LISP。 Something to keep an eye on if you are exploring functionality stage.如果您正在探索功能阶段,请注意一些事项。 Maybe Rob Blackwell will be glad to hear you're considering it.也许罗布布莱克威尔会很高兴听到你正在考虑它。

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 Evaluator class and Roslyn the ScriptEngine , both make it a breeze setting up a script environment. Mono 包含Evaluator类和 Roslyn ScriptEngine ,两者都使设置脚本环境变得轻而易举。 Of course something like ScriptCS already builds on that (Roslyn) and gives you more features.当然,像ScriptCS这样的东西已经建立在 (Roslyn) 之上,并为您提供更多功能。

For an C# script environment built on Mono.CSharp you can check out CShell (which I made).对于基于 Mono.CSharp 构建的 C# 脚本环境,您可以查看CShell (我制作的)。

Depending on your needs, the SILK library might be a good option.根据您的需要, SILK库可能是一个不错的选择。

It's an easy to use interpreter.这是一个易于使用的解释器。 The interpreted language is not C#.解释型语言不是 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.这是一种易于使用的自定义语言(很少标点符号,不区分大小写等)但它确实支持函数。

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.也就是说,当解释的代码调用您的内部函数之一时,它会在您的程序中引发一个事件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM