ProfileSection.AutomaticSaveEnabled Egenskap

Definition

Hämtar eller anger ett värde som avgör om ändringar i användarprofilinformation automatiskt sparas vid sidavslut.

public:
 property bool AutomaticSaveEnabled { bool get(); void set(bool value); };
[System.Configuration.ConfigurationProperty("automaticSaveEnabled", DefaultValue=true)]
public bool AutomaticSaveEnabled { get; set; }
[<System.Configuration.ConfigurationProperty("automaticSaveEnabled", DefaultValue=true)>]
member this.AutomaticSaveEnabled : bool with get, set
Public Property AutomaticSaveEnabled As Boolean

Egenskapsvärde

trueom profilinformation sparas automatiskt vid sidavslut. annars . false Standardvärdet är true.

Attribut

Exempel

Följande kodexempel visar hur du använder egenskapen AutomaticSaveEnabled . Det här kodexemplet är en del av ett större exempel för ProfileSection klassen.


// Get the current AutomaticSaveEnabled property value.
Console.WriteLine(
    "Current AutomaticSaveEnabled value: '{0}'", profileSection.AutomaticSaveEnabled);

// Set the AutomaticSaveEnabled property to false.
profileSection.AutomaticSaveEnabled = false;

' Get the current AutomaticSaveEnabled property value.
Console.WriteLine( _
    "Current AutomaticSaveEnabled value: '{0}'", profileSection.AutomaticSaveEnabled)

' Set the AutomaticSaveEnabled property to false.
profileSection.AutomaticSaveEnabled = false

Kommentarer

När egenskapen AutomaticSaveEnabled är falsesparas inte ändringar i enskilda profiler om inte Save metoden för ProfileCommon klassen anropas i kod. När egenskapen AutomaticSaveEnabled är truetillåter ProfileAutoSaving händelsen också att kod åsidosätter det automatiska sparandebeteendet.

Gäller för

Se även