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