gpt4 book ai didi

c# - 为 vbscript 实现即时窗口

转载 作者:行者123 更新时间:2023-11-30 20:44:01 24 4
gpt4 key购买 nike

我已经使用 C# 实现了一个调试器。它使用 MSSCRIPT.ocx 作为 vbscript 引擎。谁能告诉我如何在其中实现即时窗口功能。

所需的功能:

应显示所有可用变量及其值:

例如

i = 1

j = i+2

[断点]

k = 3

遇到断点,立即窗口应该显示 i=1 , j=3

有什么方法可以在运行时从 vbscript 代码中获取变量?

最佳答案

MSScript 封装了一大堆接口(interface)。

SUMMARYActive Scripting is a powerful tool for adding advanced features such as macro capabilities to custom applications. This creates a need for integrated debugging services for new features added with scripting. To address this need, Microsoft has provided a set of COM interfaces for developing debugging services from within the Active Scripting framework.

This article illustrates how to use the debugging services published within the Active Scripting framework to create a full-featured script debugger that can provide a multitude of debugging actions including setting breakpoints, call stack viewing, variable browsing, immediate-window viewing, thread enumeration, and application enumeration.

事件脚本 API:为您的脚本托管应用添加强大的自定义调试

参见 https://msdn.microsoft.com/en-us/magazine/cc301316.aspx

还有 1000 万个接口(interface)。 https://msdn.microsoft.com/en-us/library/6dy78b76(v=vs.94).aspx

这就是关于使用脚本控件的帮助内容。

To make implementation of the host as flexible as possible, an OLE Automation wrapper for Windows Script is provided. However, a host that uses this wrapper object to instantiate the scripting engine does not have the degree of control over the run-time name space, the persistence model, and so on, that it would if it used Windows Script directly.

话虽如此,您可以在脚本中添加自己的代码来执行评估和执行。

关于c# - 为 vbscript 实现即时窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29879813/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com