ProfileSection.PropertySettings プロパティ
アセンブリ: System.Web (system.web.dll 内)

Dim instance As ProfileSection Dim value As RootProfilePropertySettingsCollection value = instance.PropertySettings
public: property RootProfilePropertySettingsCollection^ PropertySettings { RootProfilePropertySettingsCollection^ get (); }
構成ファイルの profile セクションの properties サブセクション内で定義されるすべてのプロパティ設定を格納している RootProfilePropertySettingsCollection オブジェクト。

PropertySettings プロパティは RootProfilePropertySettingsCollection であり、ProfilePropertySettings オブジェクトのコレクションと ProfileGroupSettings オブジェクトのコレクションを提供します。この 2 つはそれぞれ ProfilePropertySettings オブジェクトの名前付きコレクションを提供します。これらのコレクションは、ASP.NET コンパイル エンジンによって、ProfileBase から派生する ProfileCommon という名前のクラスを動的に生成するために使用されます。ProfileCommon クラスのプロパティは、この 2 つのコレクションに定義されているプロパティで構成されます。また、ProfileCommon クラスの各グループ プロパティには、そのグループ用に定義された独自のプロパティが含まれます。

PropertySettings プロパティの使用方法のコード例を次に示します。このコード例は、ProfileSection クラスのトピックで取り上げているコード例の一部分です。
' Display all current root ProfilePropertySettings. Console.WriteLine("Current Root ProfilePropertySettings:") Dim rootPPSCtr As Integer = 0 For Each rootPPS As ProfilePropertySettings In profileSection.PropertySettings Console.WriteLine(" {0}: ProfilePropertySetting '{1}'", ++rootPPSCtr, _ rootPPS.Name) Next ' Get and modify a root ProfilePropertySettings object. Console.WriteLine( _ "Display and modify 'LastReadDate' ProfilePropertySettings:") Dim profilePropertySettings As ProfilePropertySettings = _ profileSection.PropertySettings("LastReadDate") ' Get the current ReadOnly property value. Console.WriteLine( _ "Current ReadOnly value: '{0}'", profilePropertySettings.ReadOnly) ' Set the ReadOnly property to true. profilePropertySettings.ReadOnly = true ' Get the current AllowAnonymous property value. Console.WriteLine( _ "Current AllowAnonymous value: '{0}'", profilePropertySettings.AllowAnonymous) ' Set the AllowAnonymous property to true. profilePropertySettings.AllowAnonymous = true ' Get the current SerializeAs property value. Console.WriteLine( _ "Current SerializeAs value: '{0}'", profilePropertySettings.SerializeAs) ' Set the SerializeAs property to SerializationMode.Binary. profilePropertySettings.SerializeAs = SerializationMode.Binary ' Get the current Type property value. Console.WriteLine( _ "Current Type value: '{0}'", profilePropertySettings.Type) ' Set the Type property to "System.DateTime". profilePropertySettings.Type = "System.DateTime" ' Get the current DefaultValue property value. Console.WriteLine( _ "Current DefaultValue value: '{0}'", profilePropertySettings.DefaultValue) ' Set the DefaultValue property to "March 16, 2004". profilePropertySettings.DefaultValue = "March 16, 2004" ' Get the current ProviderName property value. Console.WriteLine( _ "Current ProviderName value: '{0}'", profilePropertySettings.Provider) ' Set the ProviderName property to "AspNetSqlRoleProvider". profilePropertySettings.Provider = "AspNetSqlRoleProvider" ' Get the current Name property value. Console.WriteLine( _ "Current Name value: '{0}'", profilePropertySettings.Name) ' Set the Name property to "LastAccessDate". profilePropertySettings.Name = "LastAccessDate" ' 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 ' Add a new group. Dim newPropGroup As ProfileGroupSettings = new ProfileGroupSettings("Forum") profileSection.PropertySettings.GroupSettings.Add(newPropGroup) ' Add a new PropertySettings to the group. Dim newProp As ProfilePropertySettings = new ProfilePropertySettings("AvatarImage") newProp.Type = "System.String, System.dll" newPropGroup.PropertySettings.Add(newProp) ' Remove a PropertySettings from the group. newPropGroup.PropertySettings.Remove("AvatarImage") newPropGroup.PropertySettings.RemoveAt(0) ' Clear all PropertySettings from the group. newPropGroup.PropertySettings.Clear()
// Display all current root ProfilePropertySettings. Console.WriteLine("Current Root ProfilePropertySettings:"); int rootPPSCtr = 0; foreach (ProfilePropertySettings rootPPS in profileSection.PropertySettings) { Console.WriteLine(" {0}: ProfilePropertySetting '{1}'", ++rootPPSCtr , rootPPS.Name); } // Get and modify a root ProfilePropertySettings object. Console.WriteLine( "Display and modify 'LastReadDate' ProfilePropertySettings:"); ProfilePropertySettings profilePropertySettings = profileSection.PropertySettings["LastReadDate"]; // Get the current ReadOnly property value. Console.WriteLine( "Current ReadOnly value: '{0}'", profilePropertySettings.ReadOnly); // Set the ReadOnly property to true. profilePropertySettings.ReadOnly = true; // Get the current AllowAnonymous property value. Console.WriteLine( "Current AllowAnonymous value: '{0}'", profilePropertySettings.AllowAnonymous); // Set the AllowAnonymous property to true. profilePropertySettings.AllowAnonymous = true; // Get the current SerializeAs property value. Console.WriteLine( "Current SerializeAs value: '{0}'", profilePropertySettings.SerializeAs); // Set the SerializeAs property to SerializationMode.Binary. profilePropertySettings.SerializeAs = SerializationMode.Binary; // Get the current Type property value. Console.WriteLine( "Current Type value: '{0}'", profilePropertySettings.Type); // Set the Type property to "System.DateTime". profilePropertySettings.Type = "System.DateTime"; // Get the current DefaultValue property value. Console.WriteLine( "Current DefaultValue value: '{0}'", profilePropertySettings.DefaultValue); // Set the DefaultValue property to "March 16, 2004". profilePropertySettings.DefaultValue = "March 16, 2004"; // Get the current ProviderName property value. Console.WriteLine( "Current ProviderName value: '{0}'", profilePropertySettings.Provider); // Set the ProviderName property to "AspNetSqlRoleProvider". profilePropertySettings.Provider = "AspNetSqlRoleProvider"; // Get the current Name property value. Console.WriteLine( "Current Name value: '{0}'", profilePropertySettings.Name); // Set the Name property to "LastAccessDate". profilePropertySettings.Name = "LastAccessDate"; // 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); } } // Add a new group. ProfileGroupSettings newPropGroup = new ProfileGroupSettings("Forum"); profileSection.PropertySettings.GroupSettings.Add(newPropGroup); // Add a new PropertySettings to the group. ProfilePropertySettings newProp = new ProfilePropertySettings("AvatarImage"); newProp.Type = "System.String, System.dll"; newPropGroup.PropertySettings.Add(newProp); // Remove a PropertySettings from the group. newPropGroup.PropertySettings.Remove("AvatarImage"); newPropGroup.PropertySettings.RemoveAt(0); // Clear all PropertySettings from the group. newPropGroup.PropertySettings.Clear();

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からProfileSection.PropertySettings プロパティを検索する場合は、下記のリンクをクリックしてください。

- ProfileSection.PropertySettings プロパティのページへのリンク