Remarque
L’accès à cette page nécessite une autorisation. Vous pouvez essayer de vous connecter ou de modifier des répertoires.
L’accès à cette page nécessite une autorisation. Vous pouvez essayer de modifier des répertoires.
Les méthodes de propriété de l’interface IADsPropertyList lisent les propriétés décrites dans le tableau suivant. Pour plus d’informations, consultez Méthodes de propriété d’interface.
Propriétés
-
PropertyCount
-
-
Type d'accès : Lecture seule
-
Type de données de script : LONG
-
// C++ method syntax HRESULT get_PropertyCount( [out] LONG* plCount );
Nombre d’éléments dans la liste de propriétés.
-
Exemples
L’exemple de code suivant montre comment déterminer le nombre d’éléments dans une liste de propriétés.
Dim propList As IADsPropertyList
Dim count As Long
On Error GoTo Cleanup
Set propList = GetObject("LDAP://dc01/DC=Fabrikam,DC=com")
propList.GetInfo
count = propList.PropertyCount
Debug.Print "Number of Properties Found: " & count
Cleanup:
If (Err.Number<>0) Then
MsgBox("An error has occurred. " & Err.Number)
End If
Set propList = Nothing
L’exemple de code suivant montre comment déterminer le nombre d’éléments dans une liste de propriétés.
int GetPropertyCacheCount(LPWSTR adsPath)
{
IADsPropertyList *pList;
IADs *pObj;
HRESULT hr = S_OK;
if(!adsPath)
{
_tprintf(TEXT("Invalid ADsPath."));
return -1;
}
HRESULT hr = ADsGetObject(adsPath,
IID_IADsPropertyList,
(void**)&pList);
// Initialize the property cache.
hr = pList->QueryInterface(IID_IADs,(void**)&pObj);
pObj->GetInfo();
pObj->Release();
// Get the property count.
hr = pList->get_PropertyCount(&count);
pList->Release();
// Return the property count if it succeeded, otherwise
// return -1.
if(SUCCEEDED(hr))
{
return count;
}
else
{
return -1;
}
}
Spécifications
| Condition requise | Valeur |
|---|---|
| Client minimal pris en charge |
Windows Vista |
| Serveur minimal pris en charge |
Windows Server 2008 |
| En-tête |
|
| DLL |
|
| IID |
IID_IADsPropertyList est défini comme C6F602B6-8F69-11D0-8528-00C04FD8D503 |