言語

ProfileSettingsCollection.Add(ProfileSettings) メソッド

定義

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

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

パラメーター

profilesSettings
ProfileSettings

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

例外

追加する ProfileSettings オブジェクトがコレクションに既に存在するか、コレクションが読み取り専用です。

次のコード例は、 Add メソッドの使用方法を示しています。 このコード例は、 HealthMonitoringSection クラスに提供されるより大きな例の一部です。


// Get the current Enabled property value.
Boolean enabledValue = healthMonitoringSection.Enabled;

// Set the Enabled property to false.
healthMonitoringSection.Enabled = false;

' Get the current Enabled property value.
Dim enabledValue As Boolean = healthMonitoringSection.Enabled

' Set the Enabled property to False.
healthMonitoringSection.Enabled = False

注釈

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

適用対象

こちらもご覧ください