# IPAddressCollection Members

> Reference: Represents a collection of IPAddress objects.

<dl class="api-definition">
<dt>Type</dt>
<dd><a href="./">IPAddressCollection</a></dd>
<dt>Namespace</dt>
<dd><a href="../namespaces/opc.uafx">Opc.UaFx</a></dd>
<dt>Assembly</dt>
<dd>Opc.UaFx.Advanced.dll</dd>
<dt>Package</dt>
<dd>Opc.UaFx.Advanced v2.59.0</dd>
</dl>

Inherits members from [Collection&lt;IPAddress&gt;](https://learn.microsoft.com/dotnet/api/system.collections.objectmodel.collection-1).

## Constructors

### IPAddressCollection

<span class="api-meta">2 overloads</span>

| Overload | Description |
|---|---|
| [IPAddressCollection()](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.ipaddresscollection/members#ipaddresscollection-noparams) | Initializes a new instance of the [IPAddressCollection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.ipaddresscollection/) class. |
| [IPAddressCollection(IList&lt;IPAddress&gt;)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.ipaddresscollection/members#ipaddresscollection-system-collections-generic-ilist-of-system-net-ipaddress) | Initializes a new instance of the [IPAddressCollection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.ipaddresscollection/) class as a wrapper for the specified `list`. |

#### IPAddressCollection()

Initializes a new instance of the [IPAddressCollection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.ipaddresscollection/) class.

<div class="api-signature" data-lang="csharp">

```csharp
public IPAddressCollection()
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub New()
```

</div>

#### IPAddressCollection(IList&lt;IPAddress&gt;)

Initializes a new instance of the [IPAddressCollection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.ipaddresscollection/) class as a wrapper for the specified `list`.

<div class="api-signature" data-lang="csharp">

```csharp
public IPAddressCollection(IList<IPAddress> list)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub New(list As IList(Of IPAddress))
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `list` | [IList](https://learn.microsoft.com/dotnet/api/system.collections.generic.ilist-1)&lt;[IPAddress](https://learn.microsoft.com/dotnet/api/system.net.ipaddress)&gt; | The list that is wrapped by the new collection. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `list` is a null reference (Nothing in Visual Basic). |

## Methods

### Add

Adds a string formatted [IPAddress](https://learn.microsoft.com/dotnet/api/system.net.ipaddress) to the end of the [IPAddressCollection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.ipaddresscollection/).

<div class="api-signature" data-lang="csharp">

```csharp
public void Add(string ipAddress)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub Add(ipAddress As String)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `ipAddress` | [String](https://learn.microsoft.com/dotnet/api/system.string) | The [string](https://learn.microsoft.com/dotnet/api/system.string) to be parsed and added to the end of the [IPAddressCollection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.ipaddresscollection/). |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `ipAddress` is an empty string. |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `ipAddress` is a null reference (Nothing in Visual Basic). |
| [FormatException](https://learn.microsoft.com/dotnet/api/system.formatexception) | The `ipAddress` is not a valid IP address. |

### Remove

Removes the first occurrence of a string formatted [IPAddress](https://learn.microsoft.com/dotnet/api/system.net.ipaddress) from the [IPAddressCollection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.ipaddresscollection/).

<div class="api-signature" data-lang="csharp">

```csharp
public void Remove(string ipAddress)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub Remove(ipAddress As String)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `ipAddress` | [String](https://learn.microsoft.com/dotnet/api/system.string) | The [string](https://learn.microsoft.com/dotnet/api/system.string) to be parsed to an [IPAddress](https://learn.microsoft.com/dotnet/api/system.net.ipaddress) which is to be removed from the [IPAddressCollection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.ipaddresscollection/). |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `ipAddress` is an empty string. |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `ipAddress` is a null reference (Nothing in Visual Basic). |
| [FormatException](https://learn.microsoft.com/dotnet/api/system.formatexception) | The `ipAddress` is not a valid IP address. |
