语言

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 具有相同名称的对象。

适用于

另请参阅