ProfilePropertySettingsCollection.Add(ProfilePropertySettings) メソッド

定義

ProfilePropertySettings オブジェクトをコレクションに追加します。

public:
 void Add(System::Web::Configuration::ProfilePropertySettings ^ propertySettings);
public void Add (System.Web.Configuration.ProfilePropertySettings propertySettings);
member this.Add : System.Web.Configuration.ProfilePropertySettings -> unit
Public Sub Add (propertySettings As ProfilePropertySettings)

パラメーター

propertySettings
ProfilePropertySettings

コレクションに追加する ProfilePropertySettings オブジェクト。

例外

追加する ProfilePropertySettings オブジェクトが既にコレクションに存在しているか、またはコレクションが読み取り専用です。

Add メソッドを使用するコード例を次に示します。 このコード例は、ProfileSection クラスのために提供されている大規模な例の一部です。

// Add a new PropertySettings to the group.
ProfilePropertySettings newProp = new ProfilePropertySettings("AvatarImage");
newProp.Type = "System.String, System.dll";
newPropGroup.PropertySettings.Add(newProp);
' Add a new PropertySettings to the group.
Dim newProp As ProfilePropertySettings = new ProfilePropertySettings("AvatarImage")
newProp.Type = "System.String, System.dll"
newPropGroup.PropertySettings.Add(newProp)

注釈

コレクションに同じ名前のオブジェクトを ProfilePropertySettings 含めてはなりません。

適用対象

こちらもご覧ください