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.

适用于

另请参阅