SWbemRefreshableItem 개체

SWbemRefreshableItem 개체는 SWbemRefresher 개체의 단일 항목을 나타냅니다. SWbemRefreshableItem 개체는 SWbemRefresherAddAddEnum 메서드를 통해 가져옵니다. 이 개체는 VBScript CreateObject 호출로 만들 수 없습니다.

멤버

SWbemRefreshableItem 개체에는 다음과 같은 형식의 멤버가 있습니다.

메서드

SWbemRefreshableItem 개체에는 다음과 같은 메서드가 있습니다.

메서드 설명
제거 부모 SWbemRefresher 개체에서 SWbemRefreshableItem 개체를 제거합니다.

속성

SWbemRefreshableItem 개체에는 다음과 같은 속성이 있습니다.

속성 액세스 유형 설명
Index
읽기/쓰기
부모 SWbemRefresher 개체에 있는 항목의 인덱스입니다.
IsSet
읽기/쓰기
SWbemRefreshableItem 개체가 단일 개체 또는 개체 집합을 의미하는지 여부를 나타냅니다.
Object
읽기/쓰기
새로 고쳐진 단일 SWbemObject 개체를 나타냅니다.
ObjectSet
읽기/쓰기
새로 고칠 개체 집합을 나타냅니다.
Refresher
읽기 전용
SWbemRefreshableItem 개체를 포함하는 부모 SWbemRefresher 개체를 나타냅니다.

설명

VBScript 메서드 GetObject를 사용하여 SWbemRefreshableItem 개체를 직접 만들 수 없습니다.

예제

다음 스크립트는 SWbemRefresher 개체를 만들고 단일 개체 및 열거자 SWbemRefreshableItem을 추가하는 방법을 보여줍니다.

' Get some namespace connections
set cimv2 = GetObject("winmgmts:root\cimv2")
set default = GetObject("winmgmts:root\default")    

' Create a refresher
set refresher = CreateObject("WbemScripting.SWbemRefresher")

' Add a single object to the refresher.
' The @ is used because this is a singleton 
' system class so only one instance exists.
set item1 = refresher.Add (default, "__CIMOMIdentification=@").Object
MsgBox "WMI Version " item1
' Add an enumerator to the refresher.
' Note that the SWbemRefreshableItem.ObjectSet 
' property must be used to designate
' this as an object set rather than a single object.
set item2 = refresher.AddEnum (cimv2, "Win32_Process").ObjectSet

' Loop three times, refreshing the items

For I= 1 To 3
MsgBox "Refresh number " & I
refresher.Refresh

' Iterate through the collection of
' processes in item2 with name of wscript
    For each process in item2
        If process.name = "wscript.exe" then
        MsgBox "Process " & process.Name & _
           " Page Faults " & process.PageFaults
        End If
    Next 
Next

' Clear out the refresher
refresher.DeleteAll 

' The following should return 0
MsgBox "Number of items in Refresher after DeleteAll " _
    & refresher.Count

요구 사항

요구 사항
지원되는 최소 클라이언트
Windows Vista
지원되는 최소 서버
Windows Server 2008
헤더
Wbemdisp.h
유형 라이브러리
Wbemdisp.tlb
DLL
Wbemdisp.dll
CLSID
CLSID_SWbemRefreshableItem
IID
IID_ISWbemRefreshableItem

추가 정보

스크립팅 API 개체