# SafeOpcFileHandle Class

<dl class="api-definition">
<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>Members</dt>
<dd><a href="./members">SafeOpcFileHandle Members</a></dd>
<dt>Also in</dt>
<dd>Opc.UaFx.Client</dd>
</dl>

Represents a wrapper class for a OPC UA file handle.

## Syntax

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

```csharp
public class SafeOpcFileHandle : SafeHandleZeroOrMinusOneIsInvalid
```

</div>

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

```vbnet
Public Class SafeOpcFileHandle
    Inherits SafeHandleZeroOrMinusOneIsInvalid
```

</div>

## Inheritance

[Object](https://learn.microsoft.com/dotnet/api/system.object) → [CriticalFinalizerObject](https://learn.microsoft.com/dotnet/api/system.runtime.constrainedexecution.criticalfinalizerobject) → [SafeHandle](https://learn.microsoft.com/dotnet/api/system.runtime.interopservices.safehandle) → [SafeHandleZeroOrMinusOneIsInvalid](https://learn.microsoft.com/dotnet/api/microsoft.win32.safehandles.safehandlezeroorminusoneisinvalid) → **SafeOpcFileHandle**

## Implements

<ul class="api-implements">
<li><a href="https://learn.microsoft.com/dotnet/api/system.idisposable">IDisposable</a></li>
</ul>

## Constructors

| Name | Description |
|---|---|
| [SafeOpcFileHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/members#safeopcfilehandle) | Initializes a new instance of the SafeOpcFileHandle class using the specified `context` used to acquire the handle `value` passed. |

## Properties

| Name | Description |
|---|---|
| [Context](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/members#context) | Gets the [OpcFileNodeContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcfilenodecontext/) within that the stored handle has been acquired and will be released in case there the wrapper gets disposed of or closed. |

## Methods

| Name | Description |
|---|---|
| [ReleaseHandle](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.safeopcfilehandle/members#releasehandle)<span class="api-meta">protected · override</span> | Executes the code required to free the handle. |

Inherits members from [SafeHandleZeroOrMinusOneIsInvalid](https://learn.microsoft.com/dotnet/api/microsoft.win32.safehandles.safehandlezeroorminusoneisinvalid), [SafeHandle](https://learn.microsoft.com/dotnet/api/system.runtime.interopservices.safehandle).

## Applies to

| Package | Versions |
|---|---|
| Opc.UaFx.Advanced | v2.5–v2.59 |
