次の方法で共有


ProfilePropertySettingsCollection.Remove(String) メソッド

定義

ProfilePropertySettings オブジェクトをコレクションから削除します。

public:
 void Remove(System::String ^ name);
public void Remove (string name);
member this.Remove : string -> unit
Public Sub Remove (name As String)

パラメーター

name
String

コレクションから削除する ProfilePropertySettings オブジェクトの名前。

例外

指定したキーを持つ ProfilePropertySettings オブジェクトがコレクションにありません。

  • または - 要素は既に削除されています。

  • または - コレクションは読み取り専用です。

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

// Remove a PropertySettings from the group.
newPropGroup.PropertySettings.Remove("AvatarImage");
newPropGroup.PropertySettings.RemoveAt(0);
' Remove a PropertySettings from the group.
newPropGroup.PropertySettings.Remove("AvatarImage")
newPropGroup.PropertySettings.RemoveAt(0)

注釈

このメソッドは、 remove 上位レベルの構成ファイルで定義されているすべての要素の構成ファイルの適切なセクションに要素を挿入します。 要素が現在の構成ファイルの適切なセクションで定義されている場合、そのエントリは構成ファイルから削除されます。 削除するオブジェクトは、コレクション内に存在する必要があります。

適用対象

こちらもご覧ください