NameValueConfigurationCollection.Add メソッド
アセンブリ: System.Configuration (system.configuration.dll 内)
構文Dim instance As NameValueConfigurationCollection Dim nameValue As NameValueConfigurationElement instance.Add(nameValue)
解説
使用例Add メソッドを使用する方法を次のコード例に示します。このコード例は、NameValueConfigurationCollection クラスのトピックで取り上げているコード例の一部分です。
For Each propertyItem As PropertyInformation In _ configSection.ElementInformation.Properties Dim nameValConfigElement As NameValueConfigurationElement = _ New NameValueConfigurationElement _ (propertyItem.Name.ToString(), propertyItem.Value.ToString()) ' Add a NameValueConfigurationElement ' to the collection. myNameValConfigCollection.Add(nameValConfigElement) Next
foreach (PropertyInformation propertyItem in configSection.ElementInformation.Properties) { NameValueConfigurationElement nameValConfigElement = new NameValueConfigurationElement (propertyItem.Name.ToString(), propertyItem.Value.ToString()); // Add a NameValueConfigurationElement // to the collection. myNameValConfigCollection.Add(nameValConfigElement); }
プラットフォームWindows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
バージョン情報
参照NameValueConfigurationCollection クラス
NameValueConfigurationCollection メンバ
System.Configuration 名前空間
- NameValueConfigurationCollection.Add メソッドのページへのリンク