列出对象方法和属性 [英] List object methods and properties

查看:38
本文介绍了列出对象方法和属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么办法可以列出 VBS 中创建对象的可用方法吗?

Is there any way to list available methods for created object in VBS?

例如:

Set IE = CreateObject("InternetExplorer.Application")

我想列出这个对象的可用属性,如:

I want to list available properties of this object, as:

IE.AddressBar
IE.Application
IE.Busy
...

或方法:

IE.ClientToWindow
IE.ExecWB
IE.GetProperty
...

如何发现 VBS 中任意有效对象的可用属性?

How can I discover available properties to arbitrary valid object in VBS?

推荐答案

VBScript 本身不支持 TypeNameVarType 函数,它会给你一个对象的类型,但不会给您可以访问其内部结构.

VBScript itself does not support type introspection outside the TypeName and VarType functions, which will give you the type of an object, but won't give you access to its internal structure.

正如其他答案所解释的,有一个 DLL 可以提供此功能,但它不随 Windows 一起提供,而且由于它是旧版 Visual Studio 的一部分,因此现在可能没有合法的方式来获取它.

As other answers explained there is a DLL that would provide this feature, but it doesn't ship with Windows, and since it was part of an old version of Visual Studio there might not be a legal way to obtain it nowadays.

这篇关于列出对象方法和属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆