ProfilePropertySettingsCollection 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
包含一組 ProfilePropertySettingsCollection 物件。
public ref class ProfilePropertySettingsCollection : System::Configuration::ConfigurationElementCollection
[System.Configuration.ConfigurationCollection(typeof(System.Web.Configuration.ProfilePropertySettings))]
public class ProfilePropertySettingsCollection : System.Configuration.ConfigurationElementCollection
[<System.Configuration.ConfigurationCollection(typeof(System.Web.Configuration.ProfilePropertySettings))>]
type ProfilePropertySettingsCollection = class
inherit ConfigurationElementCollection
Public Class ProfilePropertySettingsCollection
Inherits ConfigurationElementCollection
- 繼承
- 衍生
- 屬性
範例
以下程式碼範例說明如何使用該 PropertySettings 屬性,該屬性是該 ProfilePropertySettingsCollection 類別的實例。 此程式碼範例是本類別更大範例 ProfileSection 的一部分。
// Display all current ProfileGroupSettings.
Console.WriteLine("Current ProfileGroupSettings:");
int PGSCtr = 0;
foreach (ProfileGroupSettings propGroups in profileSection.PropertySettings.GroupSettings)
{
Console.WriteLine(" {0}: ProfileGroupSetting '{1}'", ++PGSCtr,
propGroups.Name);
int PPSCtr = 0;
foreach (ProfilePropertySettings props in propGroups.PropertySettings)
{
Console.WriteLine(" {0}: ProfilePropertySetting '{1}'", ++PPSCtr,
props.Name);
}
}
' Display all current ProfileGroupSettings.
Console.WriteLine("Current ProfileGroupSettings:")
Dim PGSCtr As Integer = 0
For Each propGroups As ProfileGroupSettings In profileSection.PropertySettings.GroupSettings
Console.WriteLine(" {0}: ProfileGroupSettings '{1}'", ++PGSCtr, _
propGroups.Name)
Dim PPSCtr As Integer = 0
For Each props As ProfilePropertySettings In propGroups.PropertySettings
Console.WriteLine(" {0}: ProfilePropertySetting '{1}'", ++PPSCtr, _
props.Name)
Next
Next
備註
設定檔的 profile 部分指定了使用者設定檔的結構。 執行時,ASP.NET 編譯系統會利用該 profile 區段指定的資訊產生一個稱為 ProfileCommon的類別,該類別由 衍生而 ProfileBase來。
ProfileCommon類別定義基於設定檔該profile節子節中定義properties的屬性。 每個使用者設定檔都會建立一個這個類別的實例,你可以透過這個 Profile 屬性存取程式碼中的各個設定檔值。 欲了解更多關於剖面屬性的資訊,請參閱 ASP.NET 剖面屬性概覽。 欲了解更多關於 ASP.NET 2.0新增設定檔功能,請參見 ASP.NET 設定檔屬性總覽。
建構函式
| 名稱 | Description |
|---|---|
| ProfilePropertySettingsCollection() |
建立一個新的類別實例 ProfilePropertySettingsCollection 。 |
屬性
方法
明確介面實作
| 名稱 | Description |
|---|---|
| ICollection.CopyTo(Array, Int32) |
將 複製 ConfigurationElementCollection 到 array。 (繼承來源 ConfigurationElementCollection) |
擴充方法
| 名稱 | Description |
|---|---|
| AsParallel(IEnumerable) |
啟用查詢的平行處理。 |
| AsQueryable(IEnumerable) |
將 IEnumerable 轉換成 IQueryable。 |
| Cast<TResult>(IEnumerable) |
將 IEnumerable 的項目轉換成指定的型別。 |
| OfType<TResult>(IEnumerable) |
根據指定的型別篩選 IEnumerable 的專案。 |