FileStream.SafeFileHandle Property

Definition

Gets a SafeFileHandle object that represents the operating system file handle for the file that the current FileStream object encapsulates.

public:
 virtual property Microsoft::Win32::SafeHandles::SafeFileHandle ^ SafeFileHandle { Microsoft::Win32::SafeHandles::SafeFileHandle ^ get(); };
public virtual Microsoft.Win32.SafeHandles.SafeFileHandle SafeFileHandle { get; }
public virtual Microsoft.Win32.SafeHandles.SafeFileHandle SafeFileHandle { [System.Security.SecurityCritical] get; }
member this.SafeFileHandle : Microsoft.Win32.SafeHandles.SafeFileHandle
[<get: System.Security.SecurityCritical>]
member this.SafeFileHandle : Microsoft.Win32.SafeHandles.SafeFileHandle
Public Overridable ReadOnly Property SafeFileHandle As SafeFileHandle

Property Value

An object that represents the operating system file handle for the file that the current FileStream object encapsulates.

Attributes

Remarks

The SafeFileHandle property automatically flushes the stream and sets the current stream position to 0. This allows the file to be moved or the stream position to be reset by another stream using the SafeFileHandle returned by this property.

Applies to

See also