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 重新分析點,否則無法存取。

適用於