Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

RegistryKey.Flush Method

Writes all the attributes of the specified open registry key into the registry.

Namespace:  Microsoft.Win32
Assembly:  mscorlib (in mscorlib.dll)
public void Flush()

It is not necessary to call Flush to write out changes to a key. Registry changes are flushed to disk when the registry uses its lazy flusher. Lazy flushing occurs automatically and regularly after a system-specified time interval. Registry changes are also flushed to disk at system shutdown.

Unlike Close, the Flush function returns only when all the data has been written to the registry.

The Flush function might also write out parts of or all of the other keys. Calling this function excessively can have a negative effect on an application's performance.

An application should only call Flush if it must be absolute certain that registry changes are recorded to disk. In general, Flush rarely, if ever, need be used.

.NET Framework

Supported in: 4.5.1, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft. All rights reserved.