IADsFileServiceOperations::Resources 方法 (iads.h)

IADsFileServiceOperations::Resources 方法获取指向表示此文件服务上当前打开的资源对象集合上的 IADsCollection 接口的指针的指针。

语法

HRESULT Resources(
  [out] IADsCollection **ppResources
);

参数

[out] ppResources

指向 指向 IADsCollection 接口的指针的指针,该接口随后可用于枚举实现 IADsResource 接口并表示此文件服务的当前打开资源的对象。

返回值

此方法支持标准返回值,包括S_OK。 有关详细信息和其他返回值,请参阅 ADSI 错误代码

注解

传统目录服务仅提供有关基础数据存储中表示的目录服务元素的数据。 有关文件服务资源的数据可能无法从基础目录存储中获取。

示例

下面的代码示例演示如何枚举由文件服务管理的开放资源。

Dim fso As IADsFileServiceOperations
On Error GoTo Cleanup

' Bind to a file service operation on "myComputer" 
' in the local domain.
Set fso = GetObject("WinNT://myComputer/LanmanServer")

' Enumerate resources.
For Each resource In fso.Resources
    MsgBox "Resource path: " & resource.Path
Next resource

Cleanup:
    If (Err.Number<>0) Then
        MsgBox("An error has occurred. " & Err.Number)
    End If
    Set fso = Nothing

有关使用 IADsFileServiceOperations::Resources 方法的代码示例,请参阅 IADsResource 中给出的代码示例。

要求

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

另请参阅

IADsFileService

IADsFileServiceOperations

IADsResource