다음을 통해 공유


IADsPropertyList::P urgePropertyList 메서드(iads.h)

IADsPropertyList::P urgePropertyList 메서드는 속성 목록에서 모든 항목을 삭제합니다.

구문

HRESULT PurgePropertyList();

반환 값

이 메서드는 S_OK 포함하여 표준 HRESULT 반환 값을 지원합니다. 자세한 내용 및 기타 반환 값은 ADSI 오류 코드를 참조하세요.

설명

PurgePropertyList 메서드가 호출되면 모든 항목이 캐시에서 제거됩니다. 따라서 그 후에 GetPropertyItem 을 호출하면 오류가 발생합니다. PurgePropertyList는 캐시의 내용에만 영향을 미치며 디렉터리의 실제 개체에 대한 속성에는 영향을 주지 않습니다. 즉, PurgePropertyList를 호출한 후 SetInfo를 호출해도 디렉터리 개체의 속성은 삭제되지 않습니다.

예제

다음 코드 예제에서는 IADsPropertyList::P urgePropertyList를 구현하는 방법을 보여 줍니다.

Dim propList As IADsPropertyList
 
On Error GoTo Cleanup

Set propList = GetObject("LDAP://dc03/DC=Fabrikam,DC=com")
propList.GetInfo
 
propList.PurgePropertyList
 
'- None of GetPropertyItem should work, because the list is purged.
'- The following line should generate error.
Set propEntry = propList.GetPropertyItem("adminDescription", ADSTYPE_CASE_IGNORE_STRING)

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

    Set propList = Nothing

다음 코드 예제에서는 IADsPropertyList::P urgePropertyList 호출에 의해 생성된 효과를 보여 줍니다. GetPropertyCache 함수 및 코드 예제에 대한 자세한 내용은 IADsPropertyList를 참조하세요.

IADsPropertyList *GetPropertyCache(LPWSTR);
 
void TestPurgePropertyList()
{
    IADsPropertyList *pList;
    pList=GetPropertyCache(L"WinNT://myComputer,computer");
 
    long count;

    if(pList)
    {
        pList->get_PropertyCount(&count);
        printf("Number of properties before purging: %d\n",count);
 
        count = -1;
        pList->PurgePropertyList();
        pList->get_PropertyCount(&count);
        printf("Number of properties after purging: %d\n",count);
    }
}

요구 사항

   
지원되는 최소 클라이언트 Windows Vista
지원되는 최소 서버 Windows Server 2008
대상 플랫폼 Windows
헤더 iads.h
DLL Activeds.dll

참고 항목

ADSI 오류 코드

IADsPropertyList

IADsPropertyList 속성 메서드

IADsPropertyList::GetPropertyItem