ReparsePointAware.PinAndRequireNoReparsePoints(String, Boolean) 方法

定义

打开指向现有文件或目录的 SafeFileHandle,并确认生成的规范路径与给定路径的规范路径匹配。 生成的 SafeFileHandle 是 IDisposable 的,可以在 using 语句中使用,以确保后续文件操作写入路径,而无需重新分析点。

public static Microsoft.Win32.SafeHandles.SafeFileHandle PinAndRequireNoReparsePoints (string expectedPath, bool asDirectory);
static member PinAndRequireNoReparsePoints : string * bool -> Microsoft.Win32.SafeHandles.SafeFileHandle
Public Shared Function PinAndRequireNoReparsePoints (expectedPath As String, asDirectory As Boolean) As SafeFileHandle

参数

expectedPath
String

固定的预期路径。

asDirectory
Boolean

它是文件路径还是目录路径。

返回

SafeFileHandle 指向指定的文件/目录。

例外

路径包含 Windows 重新分析点,否则无法访问。

适用于