ProfileSettingsCollection.Add(ProfileSettings) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
将对象 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 具有相同名称的对象。