FileStream.SafeFileHandle FileStream.SafeFileHandle FileStream.SafeFileHandle FileStream.SafeFileHandle Property

定义

获取 SafeFileHandle 对象,它代表当前 FileStream 对象所封装的文件的操作系统文件句柄。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(); };
[get: System.Security.SecurityCritical]
public virtual Microsoft.Win32.SafeHandles.SafeFileHandle SafeFileHandle { get; }
member this.SafeFileHandle : Microsoft.Win32.SafeHandles.SafeFileHandle
Public Overridable ReadOnly Property SafeFileHandle As SafeFileHandle

属性值

一个对象,该对象表示当前 FileStream 对象封装的文件的操作系统文件句柄。An object that represents the operating system file handle for the file that the current FileStream object encapsulates.

注解

SafeFileHandle属性自动刷新流并将当前流位置设置为 0。The SafeFileHandle property automatically flushes the stream and sets the current stream position to 0. 这允许要移动的文件或流的位置重置通过另一个流使用SafeFileHandle此属性返回。This allows the file to be moved or the stream position to be reset by another stream using the SafeFileHandle returned by this property.

安全性

SecurityPermission
若要调用非托管的代码的权限。for permission to call unmanaged code. 安全操作:链接要求Security action: Link Demand 关联的枚举: UnmanagedCodeAssociated enumeration: UnmanagedCode

SecurityCriticalAttribute
直接调用方需要完全信任。requires full trust for the immediate caller. 不能由部分受信任的或透明的代码使用此成员。This member cannot be used by partially trusted or transparent code.

适用于

另请参阅