ProfilePropertySettings.Name 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定動態產生ProfilePropertySettings類別中物件名稱ProfileCommon及相關屬性。
public:
property System::String ^ Name { System::String ^ get(); void set(System::String ^ value); };
[System.Configuration.ConfigurationProperty("name", IsKey=true, IsRequired=true)]
public string Name { get; set; }
[<System.Configuration.ConfigurationProperty("name", IsKey=true, IsRequired=true)>]
member this.Name : string with get, set
Public Property Name As String
屬性值
一個包含物件名稱 ProfilePropertySettings 的字串。 預設值為 null。
- 屬性
範例
以下程式碼範例說明如何使用該 Name 屬性。 此程式碼範例是本類別更大範例 ProfileSection 的一部分。
// Get the current Name property value.
Console.WriteLine(
"Current Name value: '{0}'", profilePropertySettings.Name);
// Set the Name property to "LastAccessDate".
profilePropertySettings.Name = "LastAccessDate";
' Get the current Name property value.
Console.WriteLine( _
"Current Name value: '{0}'", profilePropertySettings.Name)
' Set the Name property to "LastAccessDate".
profilePropertySettings.Name = "LastAccessDate"
備註
執行時,ASP.NET 編譯系統會根據設定檔區段中指定的 profile 資訊產生一個稱為 ProfileCommon的類別,該類別由 衍生而 ProfileBase來。 這個類別允許你存取並修改個別使用者設定檔的數值。
ProfileCommon類別定義基於設定檔該properties節子節中定義profile的屬性。 你為類別實例 ProfilePropertySettings 指定的屬性值,將用來定義類別中 ProfileCommon 相關的屬性。