FileStream::SafeFileHandle Property
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)
public: property SafeFileHandle^ SafeFileHandle { [SecurityCriticalAttribute] [SecurityPermissionAttribute(SecurityAction::InheritanceDemand, Flags = SecurityPermissionFlag::UnmanagedCode)] virtual SafeFileHandle^ get(); }
Property Value
Type: Microsoft.Win32.SafeHandles::SafeFileHandle^An 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