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 配置檔屬性概觀。
建構函式
| ProfilePropertySettingsCollection() |
建立 ProfilePropertySettingsCollection 類別的新執行個體。 |
屬性
方法
明確介面實作
| ICollection.CopyTo(Array, Int32) |
將 ConfigurationElementCollection 複製至陣列。 (繼承來源 ConfigurationElementCollection) |
擴充方法
| Cast<TResult>(IEnumerable) |
將 IEnumerable 的項目轉換成指定的型別。 |
| OfType<TResult>(IEnumerable) |
根據指定的型別來篩選 IEnumerable 的項目。 |
| AsParallel(IEnumerable) |
啟用查詢的平行化作業。 |
| AsQueryable(IEnumerable) |
將 IEnumerable 轉換成 IQueryable。 |