# OpcFileMethods Members

> Reference: Provides static (Shared in Visual Basic) methods to directly interact with the method nodes of a file node.

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

## Methods

### Close

<span class="api-meta">static · 4 overloads</span>

| Overload | Description |
|---|---|
| [Close(OpcFileNodeContext, uint)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilemethods/members#close-opc-uafx-client-opcfilenodecontext-system-uint32)<span class="api-meta">static</span> | Closes the file maintained by the file node referenced by the `context` specified. |
| [Close(OpcFileNodeContext, uint, OpcCallMethodOptions)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilemethods/members#close-opc-uafx-client-opcfilenodecontext-system-uint32-opc-uafx-client-opccallmethodoptions)<span class="api-meta">static</span> | Closes the file maintained by the file node referenced by the `context` specified. |
| [Close(OpcClient, OpcNodeId, uint)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilemethods/members#close-opc-uafx-client-opcclient-opc-uafx-opcnodeid-system-uint32)<span class="api-meta">static</span> | Closes the file maintained by the file node referenced by the `fileNodeId` specified using the further specified [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/). |
| [Close(OpcClient, OpcNodeId, uint, OpcCallMethodOptions)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilemethods/members#close-opc-uafx-client-opcclient-opc-uafx-opcnodeid-system-uint32-opc-uafx-client-opccallmethodoptions)<span class="api-meta">static</span> | Closes the file maintained by the file node referenced by the `fileNodeId` specified using the further specified [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/). |

**Exceptions (all overloads)**

| Exception | Condition |
|---|---|
| [InvalidOperationException](https://learn.microsoft.com/dotnet/api/system.invalidoperationexception) | The file node does not exist. |
| [NotSupportedException](https://learn.microsoft.com/dotnet/api/system.notsupportedexception) | The 'Close' method node does not exist or the method node signature does not define a valid method node to close a file handle. |
| [OpcException](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcexception/) | The call of the method node failed (see exception details for more information). |

#### Close(OpcFileNodeContext, uint)

<span class="api-meta">static</span>

Closes the file maintained by the file node referenced by the `context` specified.

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

```csharp
public static void Close(OpcFileNodeContext context, uint fileHandle)
```

</div>

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

```vbnet
<CLSCompliant(False)>
Public Shared Sub Close(context As OpcFileNodeContext, fileHandle As UInteger)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `context` | [OpcFileNodeContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilenodecontext/) | The [OpcFileNodeContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilenodecontext/) to use to access the file node. |
| `fileHandle` | [UInt32](https://learn.microsoft.com/dotnet/api/system.uint32) | The numeric file handle acquired by one of the Open methods. |

**Exceptions**

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

#### Close(OpcFileNodeContext, uint, OpcCallMethodOptions)

<span class="api-meta">static</span>

Closes the file maintained by the file node referenced by the `context` specified.

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

```csharp
public static void Close(
    OpcFileNodeContext context,
    uint fileHandle,
    OpcCallMethodOptions options)
```

</div>

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

```vbnet
<CLSCompliant(False)>
Public Shared Sub Close(
    context As OpcFileNodeContext,
    fileHandle As UInteger,
    options As OpcCallMethodOptions)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `context` | [OpcFileNodeContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilenodecontext/) | The [OpcFileNodeContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilenodecontext/) to use to access the file node. |
| `fileHandle` | [UInt32](https://learn.microsoft.com/dotnet/api/system.uint32) | The numeric file handle acquired by one of the Open methods. |
| `options` | [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) | The [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) to apply before and after calling the method node to close the file handle. |

**Exceptions**

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

#### Close(OpcClient, OpcNodeId, uint)

<span class="api-meta">static</span>

Closes the file maintained by the file node referenced by the `fileNodeId` specified using the further specified [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/).

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

```csharp
public static void Close(
    OpcClient client,
    OpcNodeId fileNodeId,
    uint fileHandle)
```

</div>

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

```vbnet
<CLSCompliant(False)>
Public Shared Sub Close(
    client As OpcClient,
    fileNodeId As OpcNodeId,
    fileHandle As UInteger)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `client` | [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) | The [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) to use to call the method. |
| `fileNodeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) of the file node its 'Close' method is to be called. |
| `fileHandle` | [UInt32](https://learn.microsoft.com/dotnet/api/system.uint32) | The numeric file handle acquired by one of the Open methods. |

**Exceptions**

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

#### Close(OpcClient, OpcNodeId, uint, OpcCallMethodOptions)

<span class="api-meta">static</span>

Closes the file maintained by the file node referenced by the `fileNodeId` specified using the further specified [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/).

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

```csharp
public static void Close(
    OpcClient client,
    OpcNodeId fileNodeId,
    uint fileHandle,
    OpcCallMethodOptions options)
```

</div>

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

```vbnet
<CLSCompliant(False)>
Public Shared Sub Close(
    client As OpcClient,
    fileNodeId As OpcNodeId,
    fileHandle As UInteger,
    options As OpcCallMethodOptions)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `client` | [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) | The [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) to use to call the method. |
| `fileNodeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) of the file node its 'Close' method is to be called. |
| `fileHandle` | [UInt32](https://learn.microsoft.com/dotnet/api/system.uint32) | The numeric file handle acquired by one of the Open methods. |
| `options` | [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) | The [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) to apply before and after calling the method node to close the file handle. |

**Exceptions**

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

### GetPosition

<span class="api-meta">static · 4 overloads</span>

| Overload | Description |
|---|---|
| [GetPosition(OpcFileNodeContext, uint)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilemethods/members#getposition-opc-uafx-client-opcfilenodecontext-system-uint32)<span class="api-meta">static</span> | Retrieves the position within the file maintained by the file node referenced by the `context` specified. |
| [GetPosition(OpcFileNodeContext, uint, OpcCallMethodOptions)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilemethods/members#getposition-opc-uafx-client-opcfilenodecontext-system-uint32-opc-uafx-client-opccallmethodoptions)<span class="api-meta">static</span> | Retrieves the position within the file maintained by the file node referenced by the `context` specified. |
| [GetPosition(OpcClient, OpcNodeId, uint)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilemethods/members#getposition-opc-uafx-client-opcclient-opc-uafx-opcnodeid-system-uint32)<span class="api-meta">static</span> | Retrieves the position within the file maintained by the file node referenced by the `fileNodeId` specified using the further specified [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/). |
| [GetPosition(OpcClient, OpcNodeId, uint, OpcCallMethodOptions)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilemethods/members#getposition-opc-uafx-client-opcclient-opc-uafx-opcnodeid-system-uint32-opc-uafx-client-opccallmethodoptions)<span class="api-meta">static</span> | Retrieves the position within the file maintained by the file node referenced by the `fileNodeId` specified using the further specified [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/). |

**Exceptions (all overloads)**

| Exception | Condition |
|---|---|
| [InvalidOperationException](https://learn.microsoft.com/dotnet/api/system.invalidoperationexception) | The file node does not exist. |
| [NotSupportedException](https://learn.microsoft.com/dotnet/api/system.notsupportedexception) | The 'GetPosition' method node does not exist or the method node signature does not define a valid method node to query the position in a file. |
| [OpcException](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcexception/) | The call of the method node failed (see exception details for more information). |

#### GetPosition(OpcFileNodeContext, uint)

<span class="api-meta">static</span>

Retrieves the position within the file maintained by the file node referenced by the `context` specified.

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

```csharp
public static ulong GetPosition(OpcFileNodeContext context, uint fileHandle)
```

</div>

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

```vbnet
<CLSCompliant(False)>
Public Shared Function GetPosition(
    context As OpcFileNodeContext,
    fileHandle As UInteger) As ULong
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `context` | [OpcFileNodeContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilenodecontext/) | The [OpcFileNodeContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilenodecontext/) to use to access the file node. |
| `fileHandle` | [UInt32](https://learn.microsoft.com/dotnet/api/system.uint32) | The numeric file handle acquired by one of the Open methods. |

**Returns**

[UInt64](https://learn.microsoft.com/dotnet/api/system.uint64)

The current position in the file.

**Exceptions**

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

#### GetPosition(OpcFileNodeContext, uint, OpcCallMethodOptions)

<span class="api-meta">static</span>

Retrieves the position within the file maintained by the file node referenced by the `context` specified.

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

```csharp
public static ulong GetPosition(
    OpcFileNodeContext context,
    uint fileHandle,
    OpcCallMethodOptions options)
```

</div>

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

```vbnet
<CLSCompliant(False)>
Public Shared Function GetPosition(
    context As OpcFileNodeContext,
    fileHandle As UInteger,
    options As OpcCallMethodOptions) As ULong
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `context` | [OpcFileNodeContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilenodecontext/) | The [OpcFileNodeContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilenodecontext/) to use to access the file node. |
| `fileHandle` | [UInt32](https://learn.microsoft.com/dotnet/api/system.uint32) | The numeric file handle acquired by one of the Open methods. |
| `options` | [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) | The [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) to apply before and after calling the method node to query the position in a file. |

**Returns**

[UInt64](https://learn.microsoft.com/dotnet/api/system.uint64)

The current position in the file.

**Exceptions**

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

#### GetPosition(OpcClient, OpcNodeId, uint)

<span class="api-meta">static</span>

Retrieves the position within the file maintained by the file node referenced by the `fileNodeId` specified using the further specified [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/).

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

```csharp
public static ulong GetPosition(
    OpcClient client,
    OpcNodeId fileNodeId,
    uint fileHandle)
```

</div>

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

```vbnet
<CLSCompliant(False)>
Public Shared Function GetPosition(
    client As OpcClient,
    fileNodeId As OpcNodeId,
    fileHandle As UInteger) As ULong
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `client` | [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) | The [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) to use to call the method. |
| `fileNodeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) of the file node its 'GetPosition' method node is to be called. |
| `fileHandle` | [UInt32](https://learn.microsoft.com/dotnet/api/system.uint32) | The numeric file handle acquired by one of the Open methods. |

**Returns**

[UInt64](https://learn.microsoft.com/dotnet/api/system.uint64)

The current position in the file.

**Exceptions**

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

#### GetPosition(OpcClient, OpcNodeId, uint, OpcCallMethodOptions)

<span class="api-meta">static</span>

Retrieves the position within the file maintained by the file node referenced by the `fileNodeId` specified using the further specified [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/).

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

```csharp
public static ulong GetPosition(
    OpcClient client,
    OpcNodeId fileNodeId,
    uint fileHandle,
    OpcCallMethodOptions options)
```

</div>

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

```vbnet
<CLSCompliant(False)>
Public Shared Function GetPosition(
    client As OpcClient,
    fileNodeId As OpcNodeId,
    fileHandle As UInteger,
    options As OpcCallMethodOptions) As ULong
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `client` | [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) | The [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) to use to call the method. |
| `fileNodeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) of the file node its 'GetPosition' method node is to be called. |
| `fileHandle` | [UInt32](https://learn.microsoft.com/dotnet/api/system.uint32) | The numeric file handle acquired by one of the Open methods. |
| `options` | [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) | The [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) to apply before and after calling the method node to query the position in a file. |

**Returns**

[UInt64](https://learn.microsoft.com/dotnet/api/system.uint64)

The current position in the file.

**Exceptions**

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

### IsFileNode

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

| Overload | Description |
|---|---|
| [IsFileNode(OpcFileNodeContext)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilemethods/members#isfilenode-opc-uafx-client-opcfilenodecontext)<span class="api-meta">static</span> | Inspects the file node referenced by the `context` specified whether the node fulfills the requirements of accessing it in the manner of a OPC UA FileType. |
| [IsFileNode(OpcClient, OpcNodeId)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilemethods/members#isfilenode-opc-uafx-client-opcclient-opc-uafx-opcnodeid)<span class="api-meta">static</span> | Inspects the file node referenced by the `fileNodeId` specified using the further specified [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) whether the node fulfills the requirements of accessing it in the manner of a OPC UA FileType. |

#### IsFileNode(OpcFileNodeContext)

<span class="api-meta">static</span>

Inspects the file node referenced by the `context` specified whether the node fulfills the requirements of accessing it in the manner of a OPC UA FileType.

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

```csharp
public static bool IsFileNode(OpcFileNodeContext context)
```

</div>

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

```vbnet
Public Shared Function IsFileNode(context As OpcFileNodeContext) As Boolean
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `context` | [OpcFileNodeContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilenodecontext/) | The [OpcFileNodeContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilenodecontext/) to use to inspect the supposed file node. |

**Returns**

[Boolean](https://learn.microsoft.com/dotnet/api/system.boolean)

The value true if the supposed file node is concrete file node; otherwise the value false.

**Exceptions**

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

#### IsFileNode(OpcClient, OpcNodeId)

<span class="api-meta">static</span>

Inspects the file node referenced by the `fileNodeId` specified using the further specified [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) whether the node fulfills the requirements of accessing it in the manner of a OPC UA FileType.

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

```csharp
public static bool IsFileNode(OpcClient client, OpcNodeId fileNodeId)
```

</div>

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

```vbnet
Public Shared Function IsFileNode(
    client As OpcClient,
    fileNodeId As OpcNodeId) As Boolean
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `client` | [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) | The [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) to use to call the method. |
| `fileNodeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) of the file node its 'Open' method node is to be called. |

**Returns**

[Boolean](https://learn.microsoft.com/dotnet/api/system.boolean)

The value true if the supposed file node is concrete file node; otherwise the value false.

**Exceptions**

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

### Open

<span class="api-meta">static · 4 overloads</span>

| Overload | Description |
|---|---|
| [Open(OpcFileNodeContext, OpcFileMode)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilemethods/members#open-opc-uafx-client-opcfilenodecontext-opc-uafx-opcfilemode)<span class="api-meta">static</span> | Opens the file maintained by the file node referenced by the `context` specified. |
| [Open(OpcFileNodeContext, OpcFileMode, OpcCallMethodOptions)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilemethods/members#open-opc-uafx-client-opcfilenodecontext-opc-uafx-opcfilemode-opc-uafx-client-opccallmethodoptions)<span class="api-meta">static</span> | Opens the file maintained by the file node referenced by the `context` specified. |
| [Open(OpcClient, OpcNodeId, OpcFileMode)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilemethods/members#open-opc-uafx-client-opcclient-opc-uafx-opcnodeid-opc-uafx-opcfilemode)<span class="api-meta">static</span> | Opens the file maintained by the file node referenced by the `fileNodeId` specified using the further specified [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/). |
| [Open(OpcClient, OpcNodeId, OpcFileMode, OpcCallMethodOptions)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilemethods/members#open-opc-uafx-client-opcclient-opc-uafx-opcnodeid-opc-uafx-opcfilemode-opc-uafx-client-opccallmethodoptions)<span class="api-meta">static</span> | Opens the file maintained by the file node referenced by the `fileNodeId` specified using the further specified [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/). |

**Exceptions (all overloads)**

| Exception | Condition |
|---|---|
| [InvalidOperationException](https://learn.microsoft.com/dotnet/api/system.invalidoperationexception) | The file node does not exist. |
| [NotSupportedException](https://learn.microsoft.com/dotnet/api/system.notsupportedexception) | The 'Open' method node does not exist or the method node signature does not define a valid method node to open a file handle. |
| [OpcException](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcexception/) | The call of the method node failed (see exception details for more information). |

#### Open(OpcFileNodeContext, OpcFileMode)

<span class="api-meta">static</span>

Opens the file maintained by the file node referenced by the `context` specified.

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

```csharp
public static uint Open(OpcFileNodeContext context, OpcFileMode mode)
```

</div>

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

```vbnet
<CLSCompliant(False)>
Public Shared Function Open(
    context As OpcFileNodeContext,
    mode As OpcFileMode) As UInteger
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `context` | [OpcFileNodeContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilenodecontext/) | The [OpcFileNodeContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilenodecontext/) to use to access the file node. |
| `mode` | [OpcFileMode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcfilemode/) | One of the [OpcFileMode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcfilemode/) members or a combination of them. The value defines the type of requested access and how the system should open an existing file. |

**Returns**

[UInt32](https://learn.microsoft.com/dotnet/api/system.uint32)

The session based file handle to use to identify the file access requested for subsequent file method calls. To release the acquired file handle call one of the Close methods.

**Exceptions**

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

#### Open(OpcFileNodeContext, OpcFileMode, OpcCallMethodOptions)

<span class="api-meta">static</span>

Opens the file maintained by the file node referenced by the `context` specified.

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

```csharp
public static uint Open(
    OpcFileNodeContext context,
    OpcFileMode mode,
    OpcCallMethodOptions options)
```

</div>

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

```vbnet
<CLSCompliant(False)>
Public Shared Function Open(
    context As OpcFileNodeContext,
    mode As OpcFileMode,
    options As OpcCallMethodOptions) As UInteger
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `context` | [OpcFileNodeContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilenodecontext/) | The [OpcFileNodeContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilenodecontext/) to use to access the file node. |
| `mode` | [OpcFileMode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcfilemode/) | One of the [OpcFileMode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcfilemode/) members or a combination of them. The value defines the type of requested access and how the system should open an existing file. |
| `options` | [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) | The [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) to apply before and after calling the method node to open a file handle. |

**Returns**

[UInt32](https://learn.microsoft.com/dotnet/api/system.uint32)

The session based file handle to use to identify the file access requested for subsequent file method calls. To release the acquired file handle call one of the Close methods.

**Exceptions**

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

#### Open(OpcClient, OpcNodeId, OpcFileMode)

<span class="api-meta">static</span>

Opens the file maintained by the file node referenced by the `fileNodeId` specified using the further specified [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/).

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

```csharp
public static uint Open(
    OpcClient client,
    OpcNodeId fileNodeId,
    OpcFileMode mode)
```

</div>

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

```vbnet
<CLSCompliant(False)>
Public Shared Function Open(
    client As OpcClient,
    fileNodeId As OpcNodeId,
    mode As OpcFileMode) As UInteger
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `client` | [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) | The [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) to use to call the method. |
| `fileNodeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) of the file node its 'Open' method node is to be called. |
| `mode` | [OpcFileMode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcfilemode/) | One of the [OpcFileMode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcfilemode/) members or a combination of them. The value defines the type of requested access and how the system should open an existing file. |

**Returns**

[UInt32](https://learn.microsoft.com/dotnet/api/system.uint32)

The session based file handle to use to identify the file access requested for subsequent file method calls. To release the acquired file handle call one of the Close methods.

**Exceptions**

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

#### Open(OpcClient, OpcNodeId, OpcFileMode, OpcCallMethodOptions)

<span class="api-meta">static</span>

Opens the file maintained by the file node referenced by the `fileNodeId` specified using the further specified [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/).

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

```csharp
public static uint Open(
    OpcClient client,
    OpcNodeId fileNodeId,
    OpcFileMode mode,
    OpcCallMethodOptions options)
```

</div>

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

```vbnet
<CLSCompliant(False)>
Public Shared Function Open(
    client As OpcClient,
    fileNodeId As OpcNodeId,
    mode As OpcFileMode,
    options As OpcCallMethodOptions) As UInteger
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `client` | [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) | The [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) to use to call the method. |
| `fileNodeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) of the file node its 'Open' method node is to be called. |
| `mode` | [OpcFileMode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcfilemode/) | One of the [OpcFileMode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcfilemode/) members or a combination of them. The value defines the type of requested access and how the system should open an existing file. |
| `options` | [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) | The [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) to apply before and after calling the method node to open a file handle. |

**Returns**

[UInt32](https://learn.microsoft.com/dotnet/api/system.uint32)

The session based file handle to use to identify the file access requested for subsequent file method calls. To release the acquired file handle call one of the Close methods.

**Exceptions**

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

### Read

<span class="api-meta">static · 4 overloads</span>

| Overload | Description |
|---|---|
| [Read(OpcFileNodeContext, uint, int)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilemethods/members#read-opc-uafx-client-opcfilenodecontext-system-uint32-system-int32)<span class="api-meta">static</span> | Reads the number of bytes specified by `length` from the file maintained by the file node referenced by the `context` specified. |
| [Read(OpcFileNodeContext, uint, int, OpcCallMethodOptions)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilemethods/members#read-opc-uafx-client-opcfilenodecontext-system-uint32-system-int32-opc-uafx-client-opccallmethodoptions)<span class="api-meta">static</span> | Reads the number of bytes specified by `length` from the file maintained by the file node referenced by the `context` specified. |
| [Read(OpcClient, OpcNodeId, uint, int)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilemethods/members#read-opc-uafx-client-opcclient-opc-uafx-opcnodeid-system-uint32-system-int32)<span class="api-meta">static</span> | Reads the number of bytes specified by `length` from the file maintained by the file node referenced by the `fileNodeId` specified using the further specified [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/). |
| [Read(OpcClient, OpcNodeId, uint, int, OpcCallMethodOptions)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilemethods/members#read-opc-uafx-client-opcclient-opc-uafx-opcnodeid-system-uint32-system-int32-opc-uafx-client-opccallmethodoptions)<span class="api-meta">static</span> | Reads the number of bytes specified by `length` from the file maintained by the file node referenced by the `fileNodeId` specified using the further specified [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/). |

**Exceptions (all overloads)**

| Exception | Condition |
|---|---|
| [InvalidOperationException](https://learn.microsoft.com/dotnet/api/system.invalidoperationexception) | The file node does not exist. |
| [NotSupportedException](https://learn.microsoft.com/dotnet/api/system.notsupportedexception) | The 'Read' method node does not exist or the method node signature does not define a valid method node to read data from a file. |
| [OpcException](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcexception/) | The call of the method node failed (see exception details for more information). |

#### Read(OpcFileNodeContext, uint, int)

<span class="api-meta">static</span>

Reads the number of bytes specified by `length` from the file maintained by the file node referenced by the `context` specified.

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

```csharp
public static byte[] Read(
    OpcFileNodeContext context,
    uint fileHandle,
    int length)
```

</div>

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

```vbnet
<CLSCompliant(False)>
Public Shared Function Read(
    context As OpcFileNodeContext,
    fileHandle As UInteger,
    length As Integer) As Byte()
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `context` | [OpcFileNodeContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilenodecontext/) | The [OpcFileNodeContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilenodecontext/) to use to access the file node. |
| `fileHandle` | [UInt32](https://learn.microsoft.com/dotnet/api/system.uint32) | The numeric file handle acquired by one of the Open methods. |
| `length` | [Int32](https://learn.microsoft.com/dotnet/api/system.int32) | The number of bytes to read starting from the current position in the file. |

**Returns**

[Byte](https://learn.microsoft.com/dotnet/api/system.byte)[]

The data read from the file. If the end of file is reached only the data till the end of the file is read. If the specified length is longer than the maximum allowed message size of the communication, only those data fitting into the message size is read.

**Exceptions**

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

#### Read(OpcFileNodeContext, uint, int, OpcCallMethodOptions)

<span class="api-meta">static</span>

Reads the number of bytes specified by `length` from the file maintained by the file node referenced by the `context` specified.

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

```csharp
public static byte[] Read(
    OpcFileNodeContext context,
    uint fileHandle,
    int length,
    OpcCallMethodOptions options)
```

</div>

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

```vbnet
<CLSCompliant(False)>
Public Shared Function Read(
    context As OpcFileNodeContext,
    fileHandle As UInteger,
    length As Integer,
    options As OpcCallMethodOptions) As Byte()
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `context` | [OpcFileNodeContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilenodecontext/) | The [OpcFileNodeContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilenodecontext/) to use to access the file node. |
| `fileHandle` | [UInt32](https://learn.microsoft.com/dotnet/api/system.uint32) | The numeric file handle acquired by one of the Open methods. |
| `length` | [Int32](https://learn.microsoft.com/dotnet/api/system.int32) | The number of bytes to read starting from the current position in the file. |
| `options` | [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) | The [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) to apply before and after calling the method node to read data from a file. |

**Returns**

[Byte](https://learn.microsoft.com/dotnet/api/system.byte)[]

The data read from the file. If the end of file is reached only the data till the end of the file is read. If the specified length is longer than the maximum allowed message size of the communication, only those data fitting into the message size is read.

**Exceptions**

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

#### Read(OpcClient, OpcNodeId, uint, int)

<span class="api-meta">static</span>

Reads the number of bytes specified by `length` from the file maintained by the file node referenced by the `fileNodeId` specified using the further specified [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/).

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

```csharp
public static byte[] Read(
    OpcClient client,
    OpcNodeId fileNodeId,
    uint fileHandle,
    int length)
```

</div>

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

```vbnet
<CLSCompliant(False)>
Public Shared Function Read(
    client As OpcClient,
    fileNodeId As OpcNodeId,
    fileHandle As UInteger,
    length As Integer) As Byte()
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `client` | [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) | The [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) to use to call the method. |
| `fileNodeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) of the file node its 'Read' method node is to be called. |
| `fileHandle` | [UInt32](https://learn.microsoft.com/dotnet/api/system.uint32) | The numeric file handle acquired by one of the Open methods. |
| `length` | [Int32](https://learn.microsoft.com/dotnet/api/system.int32) | The number of bytes to read starting from the current position in the file. |

**Returns**

[Byte](https://learn.microsoft.com/dotnet/api/system.byte)[]

The data read from the file. If the end of file is reached only the data till the end of the file is read. If the specified length is longer than the maximum allowed message size of the communication, only those data fitting into the message size is read.

**Exceptions**

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

#### Read(OpcClient, OpcNodeId, uint, int, OpcCallMethodOptions)

<span class="api-meta">static</span>

Reads the number of bytes specified by `length` from the file maintained by the file node referenced by the `fileNodeId` specified using the further specified [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/).

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

```csharp
public static byte[] Read(
    OpcClient client,
    OpcNodeId fileNodeId,
    uint fileHandle,
    int length,
    OpcCallMethodOptions options)
```

</div>

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

```vbnet
<CLSCompliant(False)>
Public Shared Function Read(
    client As OpcClient,
    fileNodeId As OpcNodeId,
    fileHandle As UInteger,
    length As Integer,
    options As OpcCallMethodOptions) As Byte()
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `client` | [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) | The [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) to use to call the method. |
| `fileNodeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) of the file node its 'Read' method node is to be called. |
| `fileHandle` | [UInt32](https://learn.microsoft.com/dotnet/api/system.uint32) | The numeric file handle acquired by one of the Open methods. |
| `length` | [Int32](https://learn.microsoft.com/dotnet/api/system.int32) | The number of bytes to read starting from the current position in the file. |
| `options` | [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) | The [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) to apply before and after calling the method node to read data from a file. |

**Returns**

[Byte](https://learn.microsoft.com/dotnet/api/system.byte)[]

The data read from the file. If the end of file is reached only the data till the end of the file is read. If the specified length is longer than the maximum allowed message size of the communication, only those data fitting into the message size is read.

**Exceptions**

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

### SecureClose

<span class="api-meta">static · 6 overloads</span>

| Overload | Description |
|---|---|
| [SecureClose(SafeOpcFileHandle)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilemethods/members#secureclose-opc-uafx-client-safeopcfilehandle)<span class="api-meta">static</span> | Closes the file `fileHandle` specified. |
| [SecureClose(SafeOpcFileHandle, OpcCallMethodOptions)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilemethods/members#secureclose-opc-uafx-client-safeopcfilehandle-opc-uafx-client-opccallmethodoptions)<span class="api-meta">static</span> | Closes the file `fileHandle` specified. |
| [SecureClose(OpcFileNodeContext, SafeOpcFileHandle)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilemethods/members#secureclose-opc-uafx-client-opcfilenodecontext-opc-uafx-client-safeopcfilehandle)<span class="api-meta">static</span> | Closes the file maintained by the file node referenced by the `context` specified. |
| [SecureClose(OpcFileNodeContext, SafeOpcFileHandle, OpcCallMethodOptions)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilemethods/members#secureclose-opc-uafx-client-opcfilenodecontext-opc-uafx-client-safeopcfilehandle-opc-uafx-client-opccallmethodoptions)<span class="api-meta">static</span> | Closes the file maintained by the file node referenced by the `context` specified. |
| [SecureClose(OpcClient, OpcNodeId, SafeOpcFileHandle)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilemethods/members#secureclose-opc-uafx-client-opcclient-opc-uafx-opcnodeid-opc-uafx-client-safeopcfilehandle)<span class="api-meta">static</span> | Closes the file maintained by the file node referenced by the `nodeId` specified using the further specified [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/). |
| [SecureClose(OpcClient, OpcNodeId, SafeOpcFileHandle, OpcCallMethodOptions)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilemethods/members#secureclose-opc-uafx-client-opcclient-opc-uafx-opcnodeid-opc-uafx-client-safeopcfilehandle-opc-uafx-client-opccallmethodoptions)<span class="api-meta">static</span> | Closes the file maintained by the file node referenced by the `nodeId` specified using the further specified [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/). |

**Exceptions (all overloads)**

| Exception | Condition |
|---|---|
| [InvalidOperationException](https://learn.microsoft.com/dotnet/api/system.invalidoperationexception) | The file node does not exist. |
| [NotSupportedException](https://learn.microsoft.com/dotnet/api/system.notsupportedexception) | The 'Close' method node does not exist or the method node signature does not define a valid method node to close a file handle. |
| [OpcException](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcexception/) | The call of the method node failed (see exception details for more information). |

#### SecureClose(SafeOpcFileHandle)

<span class="api-meta">static</span>

Closes the file `fileHandle` specified.

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

```csharp
public static void SecureClose(SafeOpcFileHandle fileHandle)
```

</div>

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

```vbnet
Public Shared Sub SecureClose(fileHandle As SafeOpcFileHandle)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `fileHandle` | [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) | The [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) acquired by one of the SecureOpen methods. |

**Exceptions**

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

#### SecureClose(SafeOpcFileHandle, OpcCallMethodOptions)

<span class="api-meta">static</span>

Closes the file `fileHandle` specified.

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

```csharp
public static void SecureClose(
    SafeOpcFileHandle fileHandle,
    OpcCallMethodOptions options)
```

</div>

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

```vbnet
Public Shared Sub SecureClose(
    fileHandle As SafeOpcFileHandle,
    options As OpcCallMethodOptions)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `fileHandle` | [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) | The [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) acquired by one of the SecureOpen methods. |
| `options` | [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) | The [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) to apply before and after calling the method node to close the file handle. |

**Exceptions**

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

#### SecureClose(OpcFileNodeContext, SafeOpcFileHandle)

<span class="api-meta">static</span>

Closes the file maintained by the file node referenced by the `context` specified.

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

```csharp
public static void SecureClose(
    OpcFileNodeContext context,
    SafeOpcFileHandle fileHandle)
```

</div>

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

```vbnet
Public Shared Sub SecureClose(
    context As OpcFileNodeContext,
    fileHandle As SafeOpcFileHandle)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `context` | [OpcFileNodeContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilenodecontext/) | The [OpcFileNodeContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilenodecontext/) to use to access the file node. |
| `fileHandle` | [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) | The [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) acquired by one of the SecureOpen methods. |

**Exceptions**

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

#### SecureClose(OpcFileNodeContext, SafeOpcFileHandle, OpcCallMethodOptions)

<span class="api-meta">static</span>

Closes the file maintained by the file node referenced by the `context` specified.

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

```csharp
public static void SecureClose(
    OpcFileNodeContext context,
    SafeOpcFileHandle fileHandle,
    OpcCallMethodOptions options)
```

</div>

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

```vbnet
Public Shared Sub SecureClose(
    context As OpcFileNodeContext,
    fileHandle As SafeOpcFileHandle,
    options As OpcCallMethodOptions)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `context` | [OpcFileNodeContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilenodecontext/) | The [OpcFileNodeContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilenodecontext/) to use to access the file node. |
| `fileHandle` | [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) | The [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) acquired by one of the SecureOpen methods. |
| `options` | [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) | The [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) to apply before and after calling the method node to close the file handle. |

**Exceptions**

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

#### SecureClose(OpcClient, OpcNodeId, SafeOpcFileHandle)

<span class="api-meta">static</span>

Closes the file maintained by the file node referenced by the `nodeId` specified using the further specified [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/).

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

```csharp
public static void SecureClose(
    OpcClient client,
    OpcNodeId nodeId,
    SafeOpcFileHandle fileHandle)
```

</div>

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

```vbnet
Public Shared Sub SecureClose(
    client As OpcClient,
    nodeId As OpcNodeId,
    fileHandle As SafeOpcFileHandle)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `client` | [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) | The [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) to use to call the method. |
| `nodeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) of the file node its 'Close' method is to be called. |
| `fileHandle` | [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) | The [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) acquired by one of the SecureOpen methods. |

**Exceptions**

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

#### SecureClose(OpcClient, OpcNodeId, SafeOpcFileHandle, OpcCallMethodOptions)

<span class="api-meta">static</span>

Closes the file maintained by the file node referenced by the `nodeId` specified using the further specified [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/).

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

```csharp
public static void SecureClose(
    OpcClient client,
    OpcNodeId nodeId,
    SafeOpcFileHandle fileHandle,
    OpcCallMethodOptions options)
```

</div>

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

```vbnet
Public Shared Sub SecureClose(
    client As OpcClient,
    nodeId As OpcNodeId,
    fileHandle As SafeOpcFileHandle,
    options As OpcCallMethodOptions)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `client` | [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) | The [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) to use to call the method. |
| `nodeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) of the file node its 'Close' method is to be called. |
| `fileHandle` | [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) | The [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) acquired by one of the SecureOpen methods. |
| `options` | [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) | The [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) to apply before and after calling the method node to close the file handle. |

**Exceptions**

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

### SecureGetPosition

<span class="api-meta">static · 6 overloads</span>

| Overload | Description |
|---|---|
| [SecureGetPosition(SafeOpcFileHandle)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilemethods/members#securegetposition-opc-uafx-client-safeopcfilehandle)<span class="api-meta">static</span> | Retrieves the position within the file identified by the `fileHandle` specified. |
| [SecureGetPosition(SafeOpcFileHandle, OpcCallMethodOptions)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilemethods/members#securegetposition-opc-uafx-client-safeopcfilehandle-opc-uafx-client-opccallmethodoptions)<span class="api-meta">static</span> | Retrieves the position within the file identified by the `fileHandle` specified. |
| [SecureGetPosition(OpcFileNodeContext, SafeOpcFileHandle)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilemethods/members#securegetposition-opc-uafx-client-opcfilenodecontext-opc-uafx-client-safeopcfilehandle)<span class="api-meta">static</span> | Retrieves the position within the file maintained by the file node referenced by the `context` specified. |
| [SecureGetPosition(OpcFileNodeContext, SafeOpcFileHandle, OpcCallMethodOptions)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilemethods/members#securegetposition-opc-uafx-client-opcfilenodecontext-opc-uafx-client-safeopcfilehandle-opc-uafx-client-opccallmethodoptions)<span class="api-meta">static</span> | Retrieves the position within the file maintained by the file node referenced by the `context` specified. |
| [SecureGetPosition(OpcClient, OpcNodeId, SafeOpcFileHandle)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilemethods/members#securegetposition-opc-uafx-client-opcclient-opc-uafx-opcnodeid-opc-uafx-client-safeopcfilehandle)<span class="api-meta">static</span> | Retrieves the position within the file maintained by the file node referenced by the `fileNodeId` specified using the further specified [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/). |
| [SecureGetPosition(OpcClient, OpcNodeId, SafeOpcFileHandle, OpcCallMethodOptions)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilemethods/members#securegetposition-opc-uafx-client-opcclient-opc-uafx-opcnodeid-opc-uafx-client-safeopcfilehandle-opc-uafx-client-opccallmethodoptions)<span class="api-meta">static</span> | Retrieves the position within the file maintained by the file node referenced by the `fileNodeId` specified using the further specified [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/). |

**Exceptions (all overloads)**

| Exception | Condition |
|---|---|
| [InvalidOperationException](https://learn.microsoft.com/dotnet/api/system.invalidoperationexception) | The file node does not exist. |
| [NotSupportedException](https://learn.microsoft.com/dotnet/api/system.notsupportedexception) | The 'GetPosition' method node does not exist or the method node signature does not define a valid method node to query the position in a file. |
| [OpcException](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcexception/) | The call of the method node failed (see exception details for more information). |

#### SecureGetPosition(SafeOpcFileHandle)

<span class="api-meta">static</span>

Retrieves the position within the file identified by the `fileHandle` specified.

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

```csharp
public static long SecureGetPosition(SafeOpcFileHandle fileHandle)
```

</div>

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

```vbnet
Public Shared Function SecureGetPosition(
    fileHandle As SafeOpcFileHandle) As Long
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `fileHandle` | [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) | The [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) acquired by one of the SecureOpen methods. |

**Returns**

[Int64](https://learn.microsoft.com/dotnet/api/system.int64)

The current position in the file.

**Exceptions**

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

#### SecureGetPosition(SafeOpcFileHandle, OpcCallMethodOptions)

<span class="api-meta">static</span>

Retrieves the position within the file identified by the `fileHandle` specified.

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

```csharp
public static long SecureGetPosition(
    SafeOpcFileHandle fileHandle,
    OpcCallMethodOptions options)
```

</div>

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

```vbnet
Public Shared Function SecureGetPosition(
    fileHandle As SafeOpcFileHandle,
    options As OpcCallMethodOptions) As Long
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `fileHandle` | [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) | The [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) acquired by one of the SecureOpen methods. |
| `options` | [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) | The [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) to apply before and after calling the method node to query the position in a file. |

**Returns**

[Int64](https://learn.microsoft.com/dotnet/api/system.int64)

The current position in the file.

**Exceptions**

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

#### SecureGetPosition(OpcFileNodeContext, SafeOpcFileHandle)

<span class="api-meta">static</span>

Retrieves the position within the file maintained by the file node referenced by the `context` specified.

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

```csharp
public static long SecureGetPosition(
    OpcFileNodeContext context,
    SafeOpcFileHandle fileHandle)
```

</div>

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

```vbnet
Public Shared Function SecureGetPosition(
    context As OpcFileNodeContext,
    fileHandle As SafeOpcFileHandle) As Long
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `context` | [OpcFileNodeContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilenodecontext/) | The [OpcFileNodeContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilenodecontext/) to use to access the file node. |
| `fileHandle` | [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) | The [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) acquired by one of the SecureOpen methods. |

**Returns**

[Int64](https://learn.microsoft.com/dotnet/api/system.int64)

The current position in the file.

**Exceptions**

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

#### SecureGetPosition(OpcFileNodeContext, SafeOpcFileHandle, OpcCallMethodOptions)

<span class="api-meta">static</span>

Retrieves the position within the file maintained by the file node referenced by the `context` specified.

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

```csharp
public static long SecureGetPosition(
    OpcFileNodeContext context,
    SafeOpcFileHandle fileHandle,
    OpcCallMethodOptions options)
```

</div>

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

```vbnet
Public Shared Function SecureGetPosition(
    context As OpcFileNodeContext,
    fileHandle As SafeOpcFileHandle,
    options As OpcCallMethodOptions) As Long
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `context` | [OpcFileNodeContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilenodecontext/) | The [OpcFileNodeContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilenodecontext/) to use to access the file node. |
| `fileHandle` | [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) | The [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) acquired by one of the SecureOpen methods. |
| `options` | [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) | The [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) to apply before and after calling the method node to query the position in a file. |

**Returns**

[Int64](https://learn.microsoft.com/dotnet/api/system.int64)

The current position in the file.

**Exceptions**

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

#### SecureGetPosition(OpcClient, OpcNodeId, SafeOpcFileHandle)

<span class="api-meta">static</span>

Retrieves the position within the file maintained by the file node referenced by the `fileNodeId` specified using the further specified [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/).

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

```csharp
public static long SecureGetPosition(
    OpcClient client,
    OpcNodeId fileNodeId,
    SafeOpcFileHandle fileHandle)
```

</div>

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

```vbnet
Public Shared Function SecureGetPosition(
    client As OpcClient,
    fileNodeId As OpcNodeId,
    fileHandle As SafeOpcFileHandle) As Long
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `client` | [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) | The [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) to use to call the method. |
| `fileNodeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) of the file node its 'GetPosition' method node is to be called. |
| `fileHandle` | [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) | The [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) acquired by one of the SecureOpen methods. |

**Returns**

[Int64](https://learn.microsoft.com/dotnet/api/system.int64)

The current position in the file.

**Exceptions**

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

#### SecureGetPosition(OpcClient, OpcNodeId, SafeOpcFileHandle, OpcCallMethodOptions)

<span class="api-meta">static</span>

Retrieves the position within the file maintained by the file node referenced by the `fileNodeId` specified using the further specified [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/).

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

```csharp
public static long SecureGetPosition(
    OpcClient client,
    OpcNodeId fileNodeId,
    SafeOpcFileHandle fileHandle,
    OpcCallMethodOptions options)
```

</div>

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

```vbnet
Public Shared Function SecureGetPosition(
    client As OpcClient,
    fileNodeId As OpcNodeId,
    fileHandle As SafeOpcFileHandle,
    options As OpcCallMethodOptions) As Long
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `client` | [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) | The [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) to use to call the method. |
| `fileNodeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) of the file node its 'GetPosition' method node is to be called. |
| `fileHandle` | [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) | The [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) acquired by one of the SecureOpen methods. |
| `options` | [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) | The [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) to apply before and after calling the method node to query the position in a file. |

**Returns**

[Int64](https://learn.microsoft.com/dotnet/api/system.int64)

The current position in the file.

**Exceptions**

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

### SecureOpen

<span class="api-meta">static · 4 overloads</span>

| Overload | Description |
|---|---|
| [SecureOpen(OpcFileNodeContext, OpcFileMode)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilemethods/members#secureopen-opc-uafx-client-opcfilenodecontext-opc-uafx-opcfilemode)<span class="api-meta">static</span> | Opens the file maintained by the file node referenced by the `context` specified. |
| [SecureOpen(OpcFileNodeContext, OpcFileMode, OpcCallMethodOptions)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilemethods/members#secureopen-opc-uafx-client-opcfilenodecontext-opc-uafx-opcfilemode-opc-uafx-client-opccallmethodoptions)<span class="api-meta">static</span> | Opens the file maintained by the file node referenced by the `context` specified. |
| [SecureOpen(OpcClient, OpcNodeId, OpcFileMode)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilemethods/members#secureopen-opc-uafx-client-opcclient-opc-uafx-opcnodeid-opc-uafx-opcfilemode)<span class="api-meta">static</span> | Opens the file maintained by the file node referenced by the `fileNodeId` specified using the further specified [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/). |
| [SecureOpen(OpcClient, OpcNodeId, OpcFileMode, OpcCallMethodOptions)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilemethods/members#secureopen-opc-uafx-client-opcclient-opc-uafx-opcnodeid-opc-uafx-opcfilemode-opc-uafx-client-opccallmethodoptions)<span class="api-meta">static</span> | Opens the file maintained by the file node referenced by the `fileNodeId` specified using the further specified [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/). |

**Exceptions (all overloads)**

| Exception | Condition |
|---|---|
| [InvalidOperationException](https://learn.microsoft.com/dotnet/api/system.invalidoperationexception) | The file node does not exist. |
| [NotSupportedException](https://learn.microsoft.com/dotnet/api/system.notsupportedexception) | The 'Open' method node does not exist or the method node signature does not define a valid method node to open a file handle. |
| [OpcException](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcexception/) | The call of the method node failed (see exception details for more information). |

#### SecureOpen(OpcFileNodeContext, OpcFileMode)

<span class="api-meta">static</span>

Opens the file maintained by the file node referenced by the `context` specified.

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

```csharp
public static SafeOpcFileHandle SecureOpen(
    OpcFileNodeContext context,
    OpcFileMode mode)
```

</div>

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

```vbnet
Public Shared Function SecureOpen(
    context As OpcFileNodeContext,
    mode As OpcFileMode) As SafeOpcFileHandle
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `context` | [OpcFileNodeContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilenodecontext/) | The [OpcFileNodeContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilenodecontext/) to use to access the file node. |
| `mode` | [OpcFileMode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcfilemode/) | One of the [OpcFileMode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcfilemode/) members or a combination of them. The value defines the type of requested access and how the system should open an existing file. |

**Returns**

[SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/)

The session based [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) to use to identify the file access requested for subsequent file method calls. To release the acquired file handle call one of the SecureClose methods or call the 'Close' method of the handle provided.

**Exceptions**

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

#### SecureOpen(OpcFileNodeContext, OpcFileMode, OpcCallMethodOptions)

<span class="api-meta">static</span>

Opens the file maintained by the file node referenced by the `context` specified.

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

```csharp
public static SafeOpcFileHandle SecureOpen(
    OpcFileNodeContext context,
    OpcFileMode mode,
    OpcCallMethodOptions options)
```

</div>

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

```vbnet
Public Shared Function SecureOpen(
    context As OpcFileNodeContext,
    mode As OpcFileMode,
    options As OpcCallMethodOptions) As SafeOpcFileHandle
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `context` | [OpcFileNodeContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilenodecontext/) | The [OpcFileNodeContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilenodecontext/) to use to access the file node. |
| `mode` | [OpcFileMode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcfilemode/) | One of the [OpcFileMode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcfilemode/) members or a combination of them. The value defines the type of requested access and how the system should open an existing file. |
| `options` | [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) | The [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) to apply before and after calling the method node to open a file handle. |

**Returns**

[SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/)

The session based [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) to use to identify the file access requested for subsequent file method calls. To release the acquired file handle call one of the SecureClose methods or call the 'Close' method of the handle provided.

**Exceptions**

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

#### SecureOpen(OpcClient, OpcNodeId, OpcFileMode)

<span class="api-meta">static</span>

Opens the file maintained by the file node referenced by the `fileNodeId` specified using the further specified [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/).

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

```csharp
public static SafeOpcFileHandle SecureOpen(
    OpcClient client,
    OpcNodeId fileNodeId,
    OpcFileMode mode)
```

</div>

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

```vbnet
Public Shared Function SecureOpen(
    client As OpcClient,
    fileNodeId As OpcNodeId,
    mode As OpcFileMode) As SafeOpcFileHandle
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `client` | [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) | The [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) to use to call the method. |
| `fileNodeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) of the file node its 'Open' method node is to be called. |
| `mode` | [OpcFileMode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcfilemode/) | One of the [OpcFileMode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcfilemode/) members or a combination of them. The value defines the type of requested access and how the system should open an existing file. |

**Returns**

[SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/)

The session based [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) to use to identify the file access requested for subsequent file method calls. To release the acquired file handle call one of the SecureClose methods or call the 'Close' method of the handle provided.

**Exceptions**

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

#### SecureOpen(OpcClient, OpcNodeId, OpcFileMode, OpcCallMethodOptions)

<span class="api-meta">static</span>

Opens the file maintained by the file node referenced by the `fileNodeId` specified using the further specified [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/).

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

```csharp
public static SafeOpcFileHandle SecureOpen(
    OpcClient client,
    OpcNodeId fileNodeId,
    OpcFileMode mode,
    OpcCallMethodOptions options)
```

</div>

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

```vbnet
Public Shared Function SecureOpen(
    client As OpcClient,
    fileNodeId As OpcNodeId,
    mode As OpcFileMode,
    options As OpcCallMethodOptions) As SafeOpcFileHandle
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `client` | [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) | The [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) to use to call the method. |
| `fileNodeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) of the file node its 'Open' method node is to be called. |
| `mode` | [OpcFileMode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcfilemode/) | One of the [OpcFileMode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcfilemode/) members or a combination of them. The value defines the type of requested access and how the system should open an existing file. |
| `options` | [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) | The [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) to apply before and after calling the method node to open a file handle. |

**Returns**

[SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/)

The session based [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) to use to identify the file access requested for subsequent file method calls. To release the acquired file handle call one of the SecureClose methods or call the 'Close' method of the handle provided.

**Exceptions**

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

### SecureRead

<span class="api-meta">static · 6 overloads</span>

| Overload | Description |
|---|---|
| [SecureRead(SafeOpcFileHandle, int)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilemethods/members#secureread-opc-uafx-client-safeopcfilehandle-system-int32)<span class="api-meta">static</span> | Reads the number of bytes specified by `length` from the file identified by the `fileHandle` specified. |
| [SecureRead(SafeOpcFileHandle, int, OpcCallMethodOptions)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilemethods/members#secureread-opc-uafx-client-safeopcfilehandle-system-int32-opc-uafx-client-opccallmethodoptions)<span class="api-meta">static</span> | Reads the number of bytes specified by `length` from the file identified by the `fileHandle` specified. |
| [SecureRead(OpcFileNodeContext, SafeOpcFileHandle, int)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilemethods/members#secureread-opc-uafx-client-opcfilenodecontext-opc-uafx-client-safeopcfilehandle-system-int32)<span class="api-meta">static</span> | Reads the number of bytes specified by `length` from the file maintained by the file node referenced by the `context` specified. |
| [SecureRead(OpcFileNodeContext, SafeOpcFileHandle, int, OpcCallMethodOptions)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilemethods/members#secureread-opc-uafx-client-opcfilenodecontext-opc-uafx-client-safeopcfilehandle-system-int32-opc-uafx-client-opccallmethodoptions)<span class="api-meta">static</span> | Reads the number of bytes specified by `length` from the file maintained by the file node referenced by the `context` specified. |
| [SecureRead(OpcClient, OpcNodeId, SafeOpcFileHandle, int)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilemethods/members#secureread-opc-uafx-client-opcclient-opc-uafx-opcnodeid-opc-uafx-client-safeopcfilehandle-system-int32)<span class="api-meta">static</span> | Reads the number of bytes specified by `length` from the file maintained by the file node referenced by the `fileNodeId` specified using the further specified [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/). |
| [SecureRead(OpcClient, OpcNodeId, SafeOpcFileHandle, int, OpcCallMethodOptions)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilemethods/members#secureread-opc-uafx-client-opcclient-opc-uafx-opcnodeid-opc-uafx-client-safeopcfilehandle-system-int32-opc-uafx-client-opccallmethodoptions)<span class="api-meta">static</span> | Reads the number of bytes specified by `length` from the file maintained by the file node referenced by the `fileNodeId` specified using the further specified [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/). |

**Exceptions (all overloads)**

| Exception | Condition |
|---|---|
| [InvalidOperationException](https://learn.microsoft.com/dotnet/api/system.invalidoperationexception) | The file node does not exist. |
| [NotSupportedException](https://learn.microsoft.com/dotnet/api/system.notsupportedexception) | The 'Read' method node does not exist or the method node signature does not define a valid method node to read data from a file. |
| [OpcException](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcexception/) | The call of the method node failed (see exception details for more information). |

#### SecureRead(SafeOpcFileHandle, int)

<span class="api-meta">static</span>

Reads the number of bytes specified by `length` from the file identified by the `fileHandle` specified.

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

```csharp
public static byte[] SecureRead(SafeOpcFileHandle fileHandle, int length)
```

</div>

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

```vbnet
Public Shared Function SecureRead(
    fileHandle As SafeOpcFileHandle,
    length As Integer) As Byte()
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `fileHandle` | [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) | The [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) acquired by one of the SecureOpen methods. |
| `length` | [Int32](https://learn.microsoft.com/dotnet/api/system.int32) | The number of bytes to read starting from the current position in the file. |

**Returns**

[Byte](https://learn.microsoft.com/dotnet/api/system.byte)[]

The data read from the file. If the end of file is reached only the data till the end of the file is read. If the specified length is longer than the maximum allowed message size of the communication, only those data fitting into the message size is read.

**Exceptions**

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

#### SecureRead(SafeOpcFileHandle, int, OpcCallMethodOptions)

<span class="api-meta">static</span>

Reads the number of bytes specified by `length` from the file identified by the `fileHandle` specified.

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

```csharp
public static byte[] SecureRead(
    SafeOpcFileHandle fileHandle,
    int length,
    OpcCallMethodOptions options)
```

</div>

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

```vbnet
Public Shared Function SecureRead(
    fileHandle As SafeOpcFileHandle,
    length As Integer,
    options As OpcCallMethodOptions) As Byte()
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `fileHandle` | [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) | The [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) acquired by one of the SecureOpen methods. |
| `length` | [Int32](https://learn.microsoft.com/dotnet/api/system.int32) | The number of bytes to read starting from the current position in the file. |
| `options` | [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) | The [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) to apply before and after calling the method node to read data from a file. |

**Returns**

[Byte](https://learn.microsoft.com/dotnet/api/system.byte)[]

The data read from the file. If the end of file is reached only the data till the end of the file is read. If the specified length is longer than the maximum allowed message size of the communication, only those data fitting into the message size is read.

**Exceptions**

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

#### SecureRead(OpcFileNodeContext, SafeOpcFileHandle, int)

<span class="api-meta">static</span>

Reads the number of bytes specified by `length` from the file maintained by the file node referenced by the `context` specified.

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

```csharp
public static byte[] SecureRead(
    OpcFileNodeContext context,
    SafeOpcFileHandle fileHandle,
    int length)
```

</div>

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

```vbnet
Public Shared Function SecureRead(
    context As OpcFileNodeContext,
    fileHandle As SafeOpcFileHandle,
    length As Integer) As Byte()
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `context` | [OpcFileNodeContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilenodecontext/) | The [OpcFileNodeContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilenodecontext/) to use to access the file node. |
| `fileHandle` | [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) | The [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) acquired by one of the SecureOpen methods. |
| `length` | [Int32](https://learn.microsoft.com/dotnet/api/system.int32) | The number of bytes to read starting from the current position in the file. |

**Returns**

[Byte](https://learn.microsoft.com/dotnet/api/system.byte)[]

The data read from the file. If the end of file is reached only the data till the end of the file is read. If the specified length is longer than the maximum allowed message size of the communication, only those data fitting into the message size is read.

**Exceptions**

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

#### SecureRead(OpcFileNodeContext, SafeOpcFileHandle, int, OpcCallMethodOptions)

<span class="api-meta">static</span>

Reads the number of bytes specified by `length` from the file maintained by the file node referenced by the `context` specified.

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

```csharp
public static byte[] SecureRead(
    OpcFileNodeContext context,
    SafeOpcFileHandle fileHandle,
    int length,
    OpcCallMethodOptions options)
```

</div>

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

```vbnet
Public Shared Function SecureRead(
    context As OpcFileNodeContext,
    fileHandle As SafeOpcFileHandle,
    length As Integer,
    options As OpcCallMethodOptions) As Byte()
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `context` | [OpcFileNodeContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilenodecontext/) | The [OpcFileNodeContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilenodecontext/) to use to access the file node. |
| `fileHandle` | [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) | The [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) acquired by one of the SecureOpen methods. |
| `length` | [Int32](https://learn.microsoft.com/dotnet/api/system.int32) | The number of bytes to read starting from the current position in the file. |
| `options` | [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) | The [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) to apply before and after calling the method node to read data from a file. |

**Returns**

[Byte](https://learn.microsoft.com/dotnet/api/system.byte)[]

The data read from the file. If the end of file is reached only the data till the end of the file is read. If the specified length is longer than the maximum allowed message size of the communication, only those data fitting into the message size is read.

**Exceptions**

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

#### SecureRead(OpcClient, OpcNodeId, SafeOpcFileHandle, int)

<span class="api-meta">static</span>

Reads the number of bytes specified by `length` from the file maintained by the file node referenced by the `fileNodeId` specified using the further specified [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/).

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

```csharp
public static byte[] SecureRead(
    OpcClient client,
    OpcNodeId fileNodeId,
    SafeOpcFileHandle fileHandle,
    int length)
```

</div>

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

```vbnet
Public Shared Function SecureRead(
    client As OpcClient,
    fileNodeId As OpcNodeId,
    fileHandle As SafeOpcFileHandle,
    length As Integer) As Byte()
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `client` | [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) | The [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) to use to call the method. |
| `fileNodeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) of the file node its 'Read' method node is to be called. |
| `fileHandle` | [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) | The [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) acquired by one of the SecureOpen methods. |
| `length` | [Int32](https://learn.microsoft.com/dotnet/api/system.int32) | The number of bytes to read starting from the current position in the file. |

**Returns**

[Byte](https://learn.microsoft.com/dotnet/api/system.byte)[]

The data read from the file. If the end of file is reached only the data till the end of the file is read. If the specified length is longer than the maximum allowed message size of the communication, only those data fitting into the message size is read.

**Exceptions**

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

#### SecureRead(OpcClient, OpcNodeId, SafeOpcFileHandle, int, OpcCallMethodOptions)

<span class="api-meta">static</span>

Reads the number of bytes specified by `length` from the file maintained by the file node referenced by the `fileNodeId` specified using the further specified [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/).

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

```csharp
public static byte[] SecureRead(
    OpcClient client,
    OpcNodeId fileNodeId,
    SafeOpcFileHandle fileHandle,
    int length,
    OpcCallMethodOptions options)
```

</div>

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

```vbnet
Public Shared Function SecureRead(
    client As OpcClient,
    fileNodeId As OpcNodeId,
    fileHandle As SafeOpcFileHandle,
    length As Integer,
    options As OpcCallMethodOptions) As Byte()
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `client` | [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) | The [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) to use to call the method. |
| `fileNodeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) of the file node its 'Read' method node is to be called. |
| `fileHandle` | [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) | The [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) acquired by one of the SecureOpen methods. |
| `length` | [Int32](https://learn.microsoft.com/dotnet/api/system.int32) | The number of bytes to read starting from the current position in the file. |
| `options` | [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) | The [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) to apply before and after calling the method node to read data from a file. |

**Returns**

[Byte](https://learn.microsoft.com/dotnet/api/system.byte)[]

The data read from the file. If the end of file is reached only the data till the end of the file is read. If the specified length is longer than the maximum allowed message size of the communication, only those data fitting into the message size is read.

**Exceptions**

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

### SecureSetPosition

<span class="api-meta">static · 6 overloads</span>

| Overload | Description |
|---|---|
| [SecureSetPosition(SafeOpcFileHandle, long)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilemethods/members#securesetposition-opc-uafx-client-safeopcfilehandle-system-int64)<span class="api-meta">static</span> | Updates the position in the file identified by the `fileHandle` specified using `position`. |
| [SecureSetPosition(SafeOpcFileHandle, long, OpcCallMethodOptions)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilemethods/members#securesetposition-opc-uafx-client-safeopcfilehandle-system-int64-opc-uafx-client-opccallmethodoptions)<span class="api-meta">static</span> | Updates the position in the file identified by the `fileHandle` specified using `position`. |
| [SecureSetPosition(OpcFileNodeContext, SafeOpcFileHandle, long)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilemethods/members#securesetposition-opc-uafx-client-opcfilenodecontext-opc-uafx-client-safeopcfilehandle-system-int64)<span class="api-meta">static</span> | Updates the position in the file maintained by the file node referenced by the `context` specified using `position`. |
| [SecureSetPosition(OpcFileNodeContext, SafeOpcFileHandle, long, OpcCallMethodOptions)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilemethods/members#securesetposition-opc-uafx-client-opcfilenodecontext-opc-uafx-client-safeopcfilehandle-system-int64-opc-uafx-client-opccallmethodoptions)<span class="api-meta">static</span> | Updates the position in the file maintained by the file node referenced by the `context` specified using `position`. |
| [SecureSetPosition(OpcClient, OpcNodeId, SafeOpcFileHandle, long)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilemethods/members#securesetposition-opc-uafx-client-opcclient-opc-uafx-opcnodeid-opc-uafx-client-safeopcfilehandle-system-int64)<span class="api-meta">static</span> | Updates the position in the file maintained by the file node referenced by the `fileNodeId` specified using the further specified [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) using `position`. |
| [SecureSetPosition(OpcClient, OpcNodeId, SafeOpcFileHandle, long, OpcCallMethodOptions)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilemethods/members#securesetposition-opc-uafx-client-opcclient-opc-uafx-opcnodeid-opc-uafx-client-safeopcfilehandle-system-int64-opc-uafx-client-opccallmethodoptions)<span class="api-meta">static</span> | Updates the position in the file maintained by the file node referenced by the `fileNodeId` specified using the further specified [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) using `position`. |

**Exceptions (all overloads)**

| Exception | Condition |
|---|---|
| [InvalidOperationException](https://learn.microsoft.com/dotnet/api/system.invalidoperationexception) | The file node does not exist. |
| [NotSupportedException](https://learn.microsoft.com/dotnet/api/system.notsupportedexception) | The 'SetPosition' method node does not exist or the method node signature does not define a valid method node to update the position in a file. |
| [OpcException](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcexception/) | The call of the method node failed (see exception details for more information). |

#### SecureSetPosition(SafeOpcFileHandle, long)

<span class="api-meta">static</span>

Updates the position in the file identified by the `fileHandle` specified using `position`.

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

```csharp
public static void SecureSetPosition(
    SafeOpcFileHandle fileHandle,
    long position)
```

</div>

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

```vbnet
Public Shared Sub SecureSetPosition(
    fileHandle As SafeOpcFileHandle,
    position As Long)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `fileHandle` | [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) | The [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) acquired by one of the SecureOpen methods. |
| `position` | [Int64](https://learn.microsoft.com/dotnet/api/system.int64) | The new position in the file. If `position` is greater than the file size the position is set to the end of the file. |

**Exceptions**

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

#### SecureSetPosition(SafeOpcFileHandle, long, OpcCallMethodOptions)

<span class="api-meta">static</span>

Updates the position in the file identified by the `fileHandle` specified using `position`.

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

```csharp
public static void SecureSetPosition(
    SafeOpcFileHandle fileHandle,
    long position,
    OpcCallMethodOptions options)
```

</div>

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

```vbnet
Public Shared Sub SecureSetPosition(
    fileHandle As SafeOpcFileHandle,
    position As Long,
    options As OpcCallMethodOptions)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `fileHandle` | [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) | The [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) acquired by one of the SecureOpen methods. |
| `position` | [Int64](https://learn.microsoft.com/dotnet/api/system.int64) | The new position in the file. If `position` is greater than the file size the position is set to the end of the file. |
| `options` | [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) | The [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) to apply before and after calling the method node to update the position in a file. |

**Exceptions**

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

#### SecureSetPosition(OpcFileNodeContext, SafeOpcFileHandle, long)

<span class="api-meta">static</span>

Updates the position in the file maintained by the file node referenced by the `context` specified using `position`.

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

```csharp
public static void SecureSetPosition(
    OpcFileNodeContext context,
    SafeOpcFileHandle fileHandle,
    long position)
```

</div>

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

```vbnet
Public Shared Sub SecureSetPosition(
    context As OpcFileNodeContext,
    fileHandle As SafeOpcFileHandle,
    position As Long)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `context` | [OpcFileNodeContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilenodecontext/) | The [OpcFileNodeContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilenodecontext/) to use to access the file node. |
| `fileHandle` | [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) | The [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) acquired by one of the SecureOpen methods. |
| `position` | [Int64](https://learn.microsoft.com/dotnet/api/system.int64) | The new position in the file. If `position` is greater than the file size the position is set to the end of the file. |

**Exceptions**

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

#### SecureSetPosition(OpcFileNodeContext, SafeOpcFileHandle, long, OpcCallMethodOptions)

<span class="api-meta">static</span>

Updates the position in the file maintained by the file node referenced by the `context` specified using `position`.

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

```csharp
public static void SecureSetPosition(
    OpcFileNodeContext context,
    SafeOpcFileHandle fileHandle,
    long position,
    OpcCallMethodOptions options)
```

</div>

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

```vbnet
Public Shared Sub SecureSetPosition(
    context As OpcFileNodeContext,
    fileHandle As SafeOpcFileHandle,
    position As Long,
    options As OpcCallMethodOptions)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `context` | [OpcFileNodeContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilenodecontext/) | The [OpcFileNodeContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilenodecontext/) to use to access the file node. |
| `fileHandle` | [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) | The [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) acquired by one of the SecureOpen methods. |
| `position` | [Int64](https://learn.microsoft.com/dotnet/api/system.int64) | The new position in the file. If `position` is greater than the file size the position is set to the end of the file. |
| `options` | [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) | The [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) to apply before and after calling the method node to update the position in a file. |

**Exceptions**

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

#### SecureSetPosition(OpcClient, OpcNodeId, SafeOpcFileHandle, long)

<span class="api-meta">static</span>

Updates the position in the file maintained by the file node referenced by the `fileNodeId` specified using the further specified [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) using `position`.

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

```csharp
public static void SecureSetPosition(
    OpcClient client,
    OpcNodeId fileNodeId,
    SafeOpcFileHandle fileHandle,
    long position)
```

</div>

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

```vbnet
Public Shared Sub SecureSetPosition(
    client As OpcClient,
    fileNodeId As OpcNodeId,
    fileHandle As SafeOpcFileHandle,
    position As Long)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `client` | [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) | The [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) to use to call the method. |
| `fileNodeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) of the file node its 'SetPosition' method node is to be called. |
| `fileHandle` | [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) | The [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) acquired by one of the SecureOpen methods. |
| `position` | [Int64](https://learn.microsoft.com/dotnet/api/system.int64) | The new position in the file. If `position` is greater than the file size the position is set to the end of the file. |

**Exceptions**

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

#### SecureSetPosition(OpcClient, OpcNodeId, SafeOpcFileHandle, long, OpcCallMethodOptions)

<span class="api-meta">static</span>

Updates the position in the file maintained by the file node referenced by the `fileNodeId` specified using the further specified [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) using `position`.

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

```csharp
public static void SecureSetPosition(
    OpcClient client,
    OpcNodeId fileNodeId,
    SafeOpcFileHandle fileHandle,
    long position,
    OpcCallMethodOptions options)
```

</div>

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

```vbnet
Public Shared Sub SecureSetPosition(
    client As OpcClient,
    fileNodeId As OpcNodeId,
    fileHandle As SafeOpcFileHandle,
    position As Long,
    options As OpcCallMethodOptions)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `client` | [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) | The [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) to use to call the method. |
| `fileNodeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) of the file node its 'SetPosition' method node is to be called. |
| `fileHandle` | [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) | The [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) acquired by one of the SecureOpen methods. |
| `position` | [Int64](https://learn.microsoft.com/dotnet/api/system.int64) | The new position in the file. If `position` is greater than the file size the position is set to the end of the file. |
| `options` | [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) | The [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) to apply before and after calling the method node to update the position in a file. |

**Exceptions**

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

### SecureWrite

<span class="api-meta">static · 6 overloads</span>

| Overload | Description |
|---|---|
| [SecureWrite(SafeOpcFileHandle, byte\[\])](#securewrite-opc-uafx-client-safeopcfilehandle-system-byte-array)<span class="api-meta">static</span> | Writes the `data` to the file identified by the `fileHandle` specified. |
| [SecureWrite(SafeOpcFileHandle, byte\[\], OpcCallMethodOptions)](#securewrite-opc-uafx-client-safeopcfilehandle-system-byte-array-opc-uafx-client-opccallmethodoptions)<span class="api-meta">static</span> | Writes the `data` to the file identified by the `fileHandle` specified. |
| [SecureWrite(OpcFileNodeContext, SafeOpcFileHandle, byte\[\])](#securewrite-opc-uafx-client-opcfilenodecontext-opc-uafx-client-safeopcfilehandle-system-byte-array)<span class="api-meta">static</span> | Writes the `data` to the file maintained by the file node referenced by the `context` specified. |
| [SecureWrite(OpcFileNodeContext, SafeOpcFileHandle, byte\[\], OpcCallMethodOptions)](#securewrite-opc-uafx-client-opcfilenodecontext-opc-uafx-client-safeopcfilehandle-system-byte-array-opc-uafx-client-opccallmethodoptions)<span class="api-meta">static</span> | Writes the `data` to the file maintained by the file node referenced by the `context` specified. |
| [SecureWrite(OpcClient, OpcNodeId, SafeOpcFileHandle, byte\[\])](#securewrite-opc-uafx-client-opcclient-opc-uafx-opcnodeid-opc-uafx-client-safeopcfilehandle-system-byte-array)<span class="api-meta">static</span> | Writes the `data` to the file maintained by the file node referenced by the `fileNodeId` specified using the further specified [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/). |
| [SecureWrite(OpcClient, OpcNodeId, SafeOpcFileHandle, byte\[\], OpcCallMethodOptions)](#securewrite-opc-uafx-client-opcclient-opc-uafx-opcnodeid-opc-uafx-client-safeopcfilehandle-system-byte-array-opc-uafx-client-opccallmethodoptions)<span class="api-meta">static</span> | Writes the `data` to the file maintained by the file node referenced by the `fileNodeId` specified using the further specified [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/). |

**Exceptions (all overloads)**

| Exception | Condition |
|---|---|
| [InvalidOperationException](https://learn.microsoft.com/dotnet/api/system.invalidoperationexception) | The file node does not exist. |
| [OpcException](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcexception/) | The call of the method node failed (see exception details for more information). |

#### SecureWrite(SafeOpcFileHandle, byte\[\])

<span class="api-meta">static</span>

Writes the `data` to the file identified by the `fileHandle` specified.

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

```csharp
public static void SecureWrite(SafeOpcFileHandle fileHandle, byte[] data)
```

</div>

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

```vbnet
Public Shared Sub SecureWrite(fileHandle As SafeOpcFileHandle, data As Byte())
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `fileHandle` | [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) | The [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) acquired by one of the SecureOpen methods. |
| `data` | [Byte](https://learn.microsoft.com/dotnet/api/system.byte)[] | The data to write to the file at the current position. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `fileHandle` is a null reference (Nothing in Visual Basic). |
| [NotSupportedException](https://learn.microsoft.com/dotnet/api/system.notsupportedexception) | The 'Write' method node does not exist or the method node signature does not define a valid method node to write data to a file. |

**Remarks**

It is server-dependent whether the written data is persistently stored if the session is ended without calling the Close method.

#### SecureWrite(SafeOpcFileHandle, byte\[\], OpcCallMethodOptions)

<span class="api-meta">static</span>

Writes the `data` to the file identified by the `fileHandle` specified.

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

```csharp
public static void SecureWrite(
    SafeOpcFileHandle fileHandle,
    byte[] data,
    OpcCallMethodOptions options)
```

</div>

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

```vbnet
Public Shared Sub SecureWrite(
    fileHandle As SafeOpcFileHandle,
    data As Byte(),
    options As OpcCallMethodOptions)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `fileHandle` | [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) | The [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) acquired by one of the SecureOpen methods. |
| `data` | [Byte](https://learn.microsoft.com/dotnet/api/system.byte)[] | The data to write to the file at the current position. |
| `options` | [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) | The [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) to apply before and after calling the method node to write data to a file. |

**Exceptions**

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

**Remarks**

It is server-dependent whether the written data is persistently stored if the session is ended without calling the Close method.

#### SecureWrite(OpcFileNodeContext, SafeOpcFileHandle, byte\[\])

<span class="api-meta">static</span>

Writes the `data` to the file maintained by the file node referenced by the `context` specified.

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

```csharp
public static void SecureWrite(
    OpcFileNodeContext context,
    SafeOpcFileHandle fileHandle,
    byte[] data)
```

</div>

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

```vbnet
Public Shared Sub SecureWrite(
    context As OpcFileNodeContext,
    fileHandle As SafeOpcFileHandle,
    data As Byte())
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `context` | [OpcFileNodeContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilenodecontext/) | The [OpcFileNodeContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilenodecontext/) to use to access the file node. |
| `fileHandle` | [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) | The [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) acquired by one of the SecureOpen methods. |
| `data` | [Byte](https://learn.microsoft.com/dotnet/api/system.byte)[] | The data to write to the file at the current position. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `context`, `fileHandle` or `data` is a null reference (Nothing in Visual Basic). |
| [NotSupportedException](https://learn.microsoft.com/dotnet/api/system.notsupportedexception) | The 'Write' method node does not exist or the method node signature does not define a valid method node to write data to a file. |

**Remarks**

It is server-dependent whether the written data is persistently stored if the session is ended without calling the Close method.

#### SecureWrite(OpcFileNodeContext, SafeOpcFileHandle, byte\[\], OpcCallMethodOptions)

<span class="api-meta">static</span>

Writes the `data` to the file maintained by the file node referenced by the `context` specified.

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

```csharp
public static void SecureWrite(
    OpcFileNodeContext context,
    SafeOpcFileHandle fileHandle,
    byte[] data,
    OpcCallMethodOptions options)
```

</div>

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

```vbnet
Public Shared Sub SecureWrite(
    context As OpcFileNodeContext,
    fileHandle As SafeOpcFileHandle,
    data As Byte(),
    options As OpcCallMethodOptions)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `context` | [OpcFileNodeContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilenodecontext/) | The [OpcFileNodeContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilenodecontext/) to use to access the file node. |
| `fileHandle` | [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) | The [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) acquired by one of the SecureOpen methods. |
| `data` | [Byte](https://learn.microsoft.com/dotnet/api/system.byte)[] | The data to write to the file at the current position. |
| `options` | [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) | The [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) to apply before and after calling the method node to write data to a file. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `context`, `fileHandle` or `data` is a null reference (Nothing in Visual Basic). |
| [NotSupportedException](https://learn.microsoft.com/dotnet/api/system.notsupportedexception) | The 'Write' method node does not exist or the method node signature does not define a valid method node to write data to a file. |

**Remarks**

It is server-dependent whether the written data is persistently stored if the session is ended without calling the Close method.

#### SecureWrite(OpcClient, OpcNodeId, SafeOpcFileHandle, byte\[\])

<span class="api-meta">static</span>

Writes the `data` to the file maintained by the file node referenced by the `fileNodeId` specified using the further specified [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/).

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

```csharp
public static void SecureWrite(
    OpcClient client,
    OpcNodeId fileNodeId,
    SafeOpcFileHandle fileHandle,
    byte[] data)
```

</div>

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

```vbnet
Public Shared Sub SecureWrite(
    client As OpcClient,
    fileNodeId As OpcNodeId,
    fileHandle As SafeOpcFileHandle,
    data As Byte())
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `client` | [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) | The [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) to use to call the method. |
| `fileNodeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) of the file node its 'Write' method node is to be called. |
| `fileHandle` | [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) | The [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) acquired by one of the SecureOpen methods. |
| `data` | [Byte](https://learn.microsoft.com/dotnet/api/system.byte)[] | The data to write to the file at the current position. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `client`, `fileNodeId`, `fileHandle` or `data` is a null reference (Nothing in Visual Basic). |
| [NotSupportedException](https://learn.microsoft.com/dotnet/api/system.notsupportedexception) | The 'Write' method node does not exist or the method node signature does not define a valid method node to write data to a file. |

**Remarks**

It is server-dependent whether the written data is persistently stored if the session is ended without calling the Close method.

#### SecureWrite(OpcClient, OpcNodeId, SafeOpcFileHandle, byte\[\], OpcCallMethodOptions)

<span class="api-meta">static</span>

Writes the `data` to the file maintained by the file node referenced by the `fileNodeId` specified using the further specified [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/).

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

```csharp
public static void SecureWrite(
    OpcClient client,
    OpcNodeId fileNodeId,
    SafeOpcFileHandle fileHandle,
    byte[] data,
    OpcCallMethodOptions options)
```

</div>

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

```vbnet
Public Shared Sub SecureWrite(
    client As OpcClient,
    fileNodeId As OpcNodeId,
    fileHandle As SafeOpcFileHandle,
    data As Byte(),
    options As OpcCallMethodOptions)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `client` | [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) | The [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) to use to call the method. |
| `fileNodeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) of the file node its 'Write' method node is to be called. |
| `fileHandle` | [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) | The [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/) acquired by one of the SecureOpen methods. |
| `data` | [Byte](https://learn.microsoft.com/dotnet/api/system.byte)[] | The data to write to the file at the current position. |
| `options` | [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) | The [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) to apply before and after calling the method node to write data to a file. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `client`, `fileNodeId`, `fileHandle` or `data` is a null reference (Nothing in Visual Basic). |
| [NotSupportedException](https://learn.microsoft.com/dotnet/api/system.notsupportedexception) | The 'Write' method node does not exist or the method node signature does not define a valid method node to write data to a file. |

**Remarks**

It is server-dependent whether the written data is persistently stored if the session is ended without calling the Close method.

### SetPosition

<span class="api-meta">static · 4 overloads</span>

| Overload | Description |
|---|---|
| [SetPosition(OpcFileNodeContext, uint, ulong)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilemethods/members#setposition-opc-uafx-client-opcfilenodecontext-system-uint32-system-uint64)<span class="api-meta">static</span> | Updates the position in the file maintained by the file node referenced by the `context` specified using `position`. |
| [SetPosition(OpcFileNodeContext, uint, ulong, OpcCallMethodOptions)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilemethods/members#setposition-opc-uafx-client-opcfilenodecontext-system-uint32-system-uint64-opc-uafx-client-opccallmethodoptions)<span class="api-meta">static</span> | Updates the position in the file maintained by the file node referenced by the `context` specified using `position`. |
| [SetPosition(OpcClient, OpcNodeId, uint, ulong)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilemethods/members#setposition-opc-uafx-client-opcclient-opc-uafx-opcnodeid-system-uint32-system-uint64)<span class="api-meta">static</span> | Updates the position in the file maintained by the file node referenced by the `fileNodeId` specified using the further specified [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) using `position`. |
| [SetPosition(OpcClient, OpcNodeId, uint, ulong, OpcCallMethodOptions)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilemethods/members#setposition-opc-uafx-client-opcclient-opc-uafx-opcnodeid-system-uint32-system-uint64-opc-uafx-client-opccallmethodoptions)<span class="api-meta">static</span> | Updates the position in the file maintained by the file node referenced by the `fileNodeId` specified using the further specified [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) using `position`. |

**Exceptions (all overloads)**

| Exception | Condition |
|---|---|
| [InvalidOperationException](https://learn.microsoft.com/dotnet/api/system.invalidoperationexception) | The file node does not exist. |
| [NotSupportedException](https://learn.microsoft.com/dotnet/api/system.notsupportedexception) | The 'SetPosition' method node does not exist or the method node signature does not define a valid method node to update the position in a file. |
| [OpcException](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcexception/) | The call of the method node failed (see exception details for more information). |

#### SetPosition(OpcFileNodeContext, uint, ulong)

<span class="api-meta">static</span>

Updates the position in the file maintained by the file node referenced by the `context` specified using `position`.

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

```csharp
public static void SetPosition(
    OpcFileNodeContext context,
    uint fileHandle,
    ulong position)
```

</div>

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

```vbnet
<CLSCompliant(False)>
Public Shared Sub SetPosition(
    context As OpcFileNodeContext,
    fileHandle As UInteger,
    position As ULong)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `context` | [OpcFileNodeContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilenodecontext/) | The [OpcFileNodeContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilenodecontext/) to use to access the file node. |
| `fileHandle` | [UInt32](https://learn.microsoft.com/dotnet/api/system.uint32) | The numeric file handle acquired by one of the Open methods. |
| `position` | [UInt64](https://learn.microsoft.com/dotnet/api/system.uint64) | The new position in the file. If `position` is greater than the file size the position is set to the end of the file. |

**Exceptions**

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

#### SetPosition(OpcFileNodeContext, uint, ulong, OpcCallMethodOptions)

<span class="api-meta">static</span>

Updates the position in the file maintained by the file node referenced by the `context` specified using `position`.

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

```csharp
public static void SetPosition(
    OpcFileNodeContext context,
    uint fileHandle,
    ulong position,
    OpcCallMethodOptions options)
```

</div>

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

```vbnet
<CLSCompliant(False)>
Public Shared Sub SetPosition(
    context As OpcFileNodeContext,
    fileHandle As UInteger,
    position As ULong,
    options As OpcCallMethodOptions)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `context` | [OpcFileNodeContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilenodecontext/) | The [OpcFileNodeContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilenodecontext/) to use to access the file node. |
| `fileHandle` | [UInt32](https://learn.microsoft.com/dotnet/api/system.uint32) | The numeric file handle acquired by one of the Open methods. |
| `position` | [UInt64](https://learn.microsoft.com/dotnet/api/system.uint64) | The new position in the file. If `position` is greater than the file size the position is set to the end of the file. |
| `options` | [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) | The [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) to apply before and after calling the method node to update the position in a file. |

**Exceptions**

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

#### SetPosition(OpcClient, OpcNodeId, uint, ulong)

<span class="api-meta">static</span>

Updates the position in the file maintained by the file node referenced by the `fileNodeId` specified using the further specified [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) using `position`.

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

```csharp
public static void SetPosition(
    OpcClient client,
    OpcNodeId fileNodeId,
    uint fileHandle,
    ulong position)
```

</div>

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

```vbnet
<CLSCompliant(False)>
Public Shared Sub SetPosition(
    client As OpcClient,
    fileNodeId As OpcNodeId,
    fileHandle As UInteger,
    position As ULong)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `client` | [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) | The [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) to use to call the method. |
| `fileNodeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) of the file node its 'SetPosition' method node is to be called. |
| `fileHandle` | [UInt32](https://learn.microsoft.com/dotnet/api/system.uint32) | The numeric file handle acquired by one of the Open methods. |
| `position` | [UInt64](https://learn.microsoft.com/dotnet/api/system.uint64) | The new position in the file. If `position` is greater than the file size the position is set to the end of the file. |

**Exceptions**

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

#### SetPosition(OpcClient, OpcNodeId, uint, ulong, OpcCallMethodOptions)

<span class="api-meta">static</span>

Updates the position in the file maintained by the file node referenced by the `fileNodeId` specified using the further specified [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) using `position`.

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

```csharp
public static void SetPosition(
    OpcClient client,
    OpcNodeId fileNodeId,
    uint fileHandle,
    ulong position,
    OpcCallMethodOptions options)
```

</div>

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

```vbnet
<CLSCompliant(False)>
Public Shared Sub SetPosition(
    client As OpcClient,
    fileNodeId As OpcNodeId,
    fileHandle As UInteger,
    position As ULong,
    options As OpcCallMethodOptions)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `client` | [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) | The [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) to use to call the method. |
| `fileNodeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) of the file node its 'SetPosition' method node is to be called. |
| `fileHandle` | [UInt32](https://learn.microsoft.com/dotnet/api/system.uint32) | The numeric file handle acquired by one of the Open methods. |
| `position` | [UInt64](https://learn.microsoft.com/dotnet/api/system.uint64) | The new position in the file. If `position` is greater than the file size the position is set to the end of the file. |
| `options` | [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) | The [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) to apply before and after calling the method node to update the position in a file. |

**Exceptions**

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

### Write

<span class="api-meta">static · 4 overloads</span>

| Overload | Description |
|---|---|
| [Write(OpcFileNodeContext, uint, byte\[\])](#write-opc-uafx-client-opcfilenodecontext-system-uint32-system-byte-array)<span class="api-meta">static</span> | Writes the `data` to the file maintained by the file node referenced by the `context` specified. |
| [Write(OpcFileNodeContext, uint, byte\[\], OpcCallMethodOptions)](#write-opc-uafx-client-opcfilenodecontext-system-uint32-system-byte-array-opc-uafx-client-opccallmethodoptions)<span class="api-meta">static</span> | Writes the `data` to the file maintained by the file node referenced by the `context` specified. |
| [Write(OpcClient, OpcNodeId, uint, byte\[\])](#write-opc-uafx-client-opcclient-opc-uafx-opcnodeid-system-uint32-system-byte-array)<span class="api-meta">static</span> | Writes the `data` to the file maintained by the file node referenced by the `fileNodeId` specified using the further specified [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/). |
| [Write(OpcClient, OpcNodeId, uint, byte\[\], OpcCallMethodOptions)](#write-opc-uafx-client-opcclient-opc-uafx-opcnodeid-system-uint32-system-byte-array-opc-uafx-client-opccallmethodoptions)<span class="api-meta">static</span> | Writes the `data` to the file maintained by the file node referenced by the `fileNodeId` specified using the further specified [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/). |

**Exceptions (all overloads)**

| Exception | Condition |
|---|---|
| [InvalidOperationException](https://learn.microsoft.com/dotnet/api/system.invalidoperationexception) | The file node does not exist. |
| [NotSupportedException](https://learn.microsoft.com/dotnet/api/system.notsupportedexception) | The 'Write' method node does not exist or the method node signature does not define a valid method node to write data to a file. |
| [OpcException](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcexception/) | The call of the method node failed (see exception details for more information). |

#### Write(OpcFileNodeContext, uint, byte\[\])

<span class="api-meta">static</span>

Writes the `data` to the file maintained by the file node referenced by the `context` specified.

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

```csharp
public static void Write(
    OpcFileNodeContext context,
    uint fileHandle,
    byte[] data)
```

</div>

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

```vbnet
<CLSCompliant(False)>
Public Shared Sub Write(
    context As OpcFileNodeContext,
    fileHandle As UInteger,
    data As Byte())
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `context` | [OpcFileNodeContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilenodecontext/) | The [OpcFileNodeContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilenodecontext/) to use to access the file node. |
| `fileHandle` | [UInt32](https://learn.microsoft.com/dotnet/api/system.uint32) | The numeric file handle acquired by one of the Open methods. |
| `data` | [Byte](https://learn.microsoft.com/dotnet/api/system.byte)[] | The data to write to the file at the current position. |

**Exceptions**

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

**Remarks**

It is server-dependent whether the written data is persistently stored if the session is ended without calling the Close method.

#### Write(OpcFileNodeContext, uint, byte\[\], OpcCallMethodOptions)

<span class="api-meta">static</span>

Writes the `data` to the file maintained by the file node referenced by the `context` specified.

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

```csharp
public static void Write(
    OpcFileNodeContext context,
    uint fileHandle,
    byte[] data,
    OpcCallMethodOptions options)
```

</div>

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

```vbnet
<CLSCompliant(False)>
Public Shared Sub Write(
    context As OpcFileNodeContext,
    fileHandle As UInteger,
    data As Byte(),
    options As OpcCallMethodOptions)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `context` | [OpcFileNodeContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilenodecontext/) | The [OpcFileNodeContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilenodecontext/) to use to access the file node. |
| `fileHandle` | [UInt32](https://learn.microsoft.com/dotnet/api/system.uint32) | The numeric file handle acquired by one of the Open methods. |
| `data` | [Byte](https://learn.microsoft.com/dotnet/api/system.byte)[] | The data to write to the file at the current position. |
| `options` | [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) | The [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) to apply before and after calling the method node to write data to a file. |

**Exceptions**

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

**Remarks**

It is server-dependent whether the written data is persistently stored if the session is ended without calling the Close method.

#### Write(OpcClient, OpcNodeId, uint, byte\[\])

<span class="api-meta">static</span>

Writes the `data` to the file maintained by the file node referenced by the `fileNodeId` specified using the further specified [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/).

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

```csharp
public static void Write(
    OpcClient client,
    OpcNodeId fileNodeId,
    uint fileHandle,
    byte[] data)
```

</div>

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

```vbnet
<CLSCompliant(False)>
Public Shared Sub Write(
    client As OpcClient,
    fileNodeId As OpcNodeId,
    fileHandle As UInteger,
    data As Byte())
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `client` | [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) | The [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) to use to call the method. |
| `fileNodeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) of the file node its 'Write' method node is to be called. |
| `fileHandle` | [UInt32](https://learn.microsoft.com/dotnet/api/system.uint32) | The numeric file handle acquired by one of the Open methods. |
| `data` | [Byte](https://learn.microsoft.com/dotnet/api/system.byte)[] | The data to write to the file at the current position. |

**Exceptions**

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

**Remarks**

It is server-dependent whether the written data is persistently stored if the session is ended without calling the Close method.

#### Write(OpcClient, OpcNodeId, uint, byte\[\], OpcCallMethodOptions)

<span class="api-meta">static</span>

Writes the `data` to the file maintained by the file node referenced by the `fileNodeId` specified using the further specified [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/).

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

```csharp
public static void Write(
    OpcClient client,
    OpcNodeId fileNodeId,
    uint fileHandle,
    byte[] data,
    OpcCallMethodOptions options)
```

</div>

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

```vbnet
<CLSCompliant(False)>
Public Shared Sub Write(
    client As OpcClient,
    fileNodeId As OpcNodeId,
    fileHandle As UInteger,
    data As Byte(),
    options As OpcCallMethodOptions)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `client` | [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) | The [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) to use to call the method. |
| `fileNodeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) of the file node its 'Write' method node is to be called. |
| `fileHandle` | [UInt32](https://learn.microsoft.com/dotnet/api/system.uint32) | The numeric file handle acquired by one of the Open methods. |
| `data` | [Byte](https://learn.microsoft.com/dotnet/api/system.byte)[] | The data to write to the file at the current position. |
| `options` | [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) | The [OpcCallMethodOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opccallmethodoptions/) to apply before and after calling the method node to write data to a file. |

**Exceptions**

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

**Remarks**

It is server-dependent whether the written data is persistently stored if the session is ended without calling the Close method.
