需要有关 Windows 脚本编写和 C# 应用程序中支持脚本编写的信息

发布于 2024-09-14 03:08:36 字数 639 浏览 10 评论 0原文

我正在尝试了解 Windows 的所有不同脚本技术(它们是什么,哪些是最常见的),并最终找出要添加到我的应用程序中的脚本类型。

我读过,使用 .NET 4 可以很容易地通过 IronRuby 和 IronPython 等动态语言(甚至是 VB 或 C#,这可能会让用户更困惑?)使您的程序可编写脚本。我的理解是,在 .NET 4 之前,为您的应用程序添加脚本支持是使其成为 COM/OLE 对象,以便人们可以使用 vbscript、winbatch、shell 脚本或其他脚本语言(或者任何支持 COM 的语言)来控制您的应用程序?常用的脚本语言有哪些?我听很多人谈论 VB for Applications。这是动态语言还是编译语言?为了允许我的应用程序通过 VB for Applications 编写脚本,我必须支持 COM/OLE 吗?我认为我倾向于支持 IronRuby 和 IronPython,因为实现对它们的支持似乎很简单,但是这些语言也可以用于编写 Windows 或其他应用程序的脚本(因此您的应用程序的脚本可能比您的应用程序具有更多的功能)布置)?您将如何设计您的应用程序以使其可编写脚本?

我知道这似乎有数千个问题,但实际上我正在寻找的只是对 Windows 脚本技术的解释(主要区别是什么,它们的使用频率如何)以及哪些是最常见/标准的使您的应用程序可编写脚本时提供支持吗?

先谢谢大家了!!

I'm trying wrap my head around all of the different scripting technologies for Windows (what are they, and which are the most common) and ultimately to figure out what type of scripting to add to my application.

I've read that with .NET 4 it's easy to make your program scriptable via dynamic languages like IronRuby and IronPython (or even VB or C# which might be more confusing for a user?) My understanding is that pre .NET 4 the way to add scripting support for your application was to make it a COM/OLE object so people could use vbscript, winbatch, shell scripts, or another scripting language (or really any language that supported COM) to control your application? What are the common scripting languages use? I've heard a lot of people talk about VB for Applications. Is that a dynamic language or a compiled language and to allow my application to be scriptable via VB for Applications would I have to support COM/OLE? I think I'm leaning towards supporting IronRuby and IronPython since it seems simple to implement support for them, but can those languages also be used to script Windows or other applications in general (and thus scripts for your application could have more features than what you laid out)? How would you go about designing your application to be scriptable?

I know that seems like a thousands questions, but really what I'm looking for is just an explanation of the scripting technologies for windows (what are the main differences, how frequently are they used) and which ones are the most common/standard to support when making your application scriptable?

Thanks in advance everyone!!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

与君绝 2024-09-21 03:08:37

我认为这取决于你想做什么。您是否尝试在应用程序池中创建动态对象或查看内存中某些内容的值。如果您需要访问对象,那么我想说也许您可以在程序中放置一个脚本窗口。如果您只是尝试配置程序的某些方面,请考虑为管理员将模块添加到 Windows powershell。这似乎就是微软正在为 sharepoint 和 sql server 等所做的事情。我会查找 powershell 是否可以满足您的需求,以便用户可以使用他们喜欢的语言并编写自己的脚本,但如果不能,请考虑将一种动态语言添加到您的应用程序中。如果今天的斜线是可信的,那么微软就不会如此积极地追究他们的责任。

I think it depends on what you are trying to do. Are you trying to create dynamic objects in your apppool or view the values of something in your memory. If you need access to you objects then I would say maybe you could put a scripting window in your program. If you are just trying to configure certain aspects of you program you and look at adding modules to windows powershell for your admins. That seems to be what microsoft is doing for things like sharepoint and sql server. I would look up if powershell can fit your needs so that users can use the language they are confortable with and write there own scripts but if not then take a look at adding one of the dynamic languages to your app. If slashdot is to be believed today then Microsoft is not going to be persuing them as agressively.

踏雪无痕 2024-09-21 03:08:37

Scrolling Game Development Kit 2 实际上会编译 UI 中输入的代码,而不是将其解释为脚本。 (它使用框架提供的 C# 编译器。)然后它可以在运行时运行并反映该代码。您考虑过这样的解决方案吗?

Scrolling Game Development Kit 2 will actually compile code entered in the UI rather than interpret it as script. (It uses the C# compiler provided with the framework.) It can then run and reflect on that code at runtime. Have you considered a solution like that?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文