次の方法で共有


The Property Cache

The property cache is a local cache used to store property data contained in the directory. This enables you to read properties or make changes to property data without making a direct connection to the server. Limiting server connections in this way increases network performance. Two methods used to exchange data between the server and the property cache include CommitChanges and RefreshCache. These methods are part of the DirectoryEntry class.

The CommitChanges method has the same features as the SetInfo method in ADSI. It saves data from the property cache to the directory. With this method, you can change numerous properties on an object before committing them to the directory. When you modify properties on multiple objects, commit property changes on one object before you change the properties of the next object. For more information about the SetInfo method, see the topic IADs::SetInfo in the MSDN Library at https://go.microsoft.com/fwlink/?LinkID=27252.

The RefreshCache method has the same features as the GetInfo method in ADSI. It loads the values for all of the object properties from the underlying directory store into the local property cache. For more information about the SetInfo method, see the topic IADs::GetInfo in the MSDN Library at https://go.microsoft.com/fwlink/?LinkID=27252.

Note

If you modify properties, use the CommitChanges method to store changes to the directory before you call RefreshCache, or the changes will be overwritten during the refresh.

When you modify properties, be aware that you understand the UsePropertyCache property on the DirectoryEntry class. When UsePropertyCache is set to its default value of true, CommitChanges must be called in order to commit changes to the directory. When set to false, changes are made to the directory automatically.

See Also

Reference

System.DirectoryServices
DirectoryEntry

Concepts

Directory Object Properties

Send comments about this topic to Microsoft.

Copyright © 2007 by Microsoft Corporation. All rights reserved.