FileStream.SafeFileHandle Property
![]() |
---|
The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience. |
Gets a SafeFileHandle object that represents the operating system file handle for the file that the current FileStream object encapsulates.
Assembly: mscorlib (in mscorlib.dll)
Property Value
Type: Microsoft.Win32.SafeHandles.SafeFileHandleAn object that represents the operating system file handle for the file that the current FileStream object encapsulates.
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.
for permission to call unmanaged code.
Security action: Link Demand
Associated enumeration: UnmanagedCode
requires full trust for the immediate caller. This member cannot be used by partially trusted or transparent code.
Available since 10
.NET Framework
Available since 2.0