Share via


DirectoryEntry.UsePropertyCache

The UsePropertyCache property gets or sets a value indicating whether the cache should be committed after each operation.

public Boolean UsePropertyCache {get; set;}
Public Property UsePropertyCache As Boolean

Property Value

Set to true if the cache should not be committed after each operation; otherwise, false. The default is true.

Remarks

By default, changes to properties are done locally to a cache, and property values to be read are cached after the first read. When the UsePropertyCache property is true, access to the DirectoryEntry object's properties is faster. Setting this to false will cause the cache to be committed after each operation.

If the UsePropertyCache property is true and you want to commit cached changes, call the CommitChanges method. To update values in the cache after changes to the directory are made, call the RefreshCache method.

Caution  If you call RefreshCache before calling CommitChanges, any uncommitted changes to the property cache will be lost.

Note  The Internet Information Services (IIS) provider does not support committing the cache after each operation.

Requirements

Client Requires Windows XP Home Edition, Windows XP Professional, Windows Me, or Windows 98.
Server Requires Windows Server 2003, Windows 2000, or Windows NT 4.0.
Namespace

Defined in System.DirectoryServices.

Assembly

Requires System.DirectoryServices (in System.DirectoryServices.dll).

.NET Framework

Requires .NET Framework 1.0.