IADsWinNTSystemInfo 接口 (iads.h)

IADsWinNTSystemInfo 接口检索有关计算机的 WinNT 系统信息。 此类系统信息包括主计算机的用户帐户名称、用户域、主机名和主域控制器。

IADsWinNTSystemInfo 接口在驻留在 Activeds.dll 中的 WinNTSystemInfo 对象上实现,该对象包含在适用于支持域的 Windows 版本的 ADSI 的标准安装中。 必须显式创建 WinNTSystemInfo 对象的实例,才能在 IADsWinNTSystemInfo 接口上调用方法。 此要求意味着使用 C/C++ 中的 CoCreateInstance 函数创建 WinNTSystemInfo 实例。

IADsWinNTSystemInfo *pNTsys;
HRESULT hr = CoCreateInstance(CLSID_WinNTSystemInfo,
                              NULL,
                              CLSCTX_INPROC_SERVER,
                              IID_IADsWinNTSystemInfo,
                              (void**)&pNTsys);

还可以在 Visual Basic 中使用 New 运算符。

Dim ntSys As New WinNTSystemInfo

还可以在脚本环境中调用 CreateObject 函数,并提供“WinNTSystemInfo”作为 ProgID。

Dim ntSys
Set ntSys = CreateObject("WinNTSystemInfo")

继承

IADsWinNTSystemInfo 接口继承自 IDispatch 接口。

要求

   
最低受支持的客户端 Windows Vista
最低受支持的服务器 Windows Server 2008
目标平台 Windows
标头 iads.h

另请参阅

CoCreateInstance

IADsWinNTSystemInfo 属性方法

IDispatch