PhysicalFileProvider 類別

定義

使用磁碟上檔案系統來查詢檔案。

public ref class PhysicalFileProvider : IDisposable, Microsoft::Extensions::FileProviders::IFileProvider
public class PhysicalFileProvider : IDisposable, Microsoft.Extensions.FileProviders.IFileProvider
type PhysicalFileProvider = class
    interface IFileProvider
    interface IDisposable
Public Class PhysicalFileProvider
Implements IDisposable, IFileProvider
繼承
PhysicalFileProvider
實作

備註

當環境變數 「DOTNET_USE_POLLING_FILE_WATCHER」 設定為 「1」 或 「true」 時,呼叫 Watch(String) 將會使用 PollingFileChangeToken

建構函式

PhysicalFileProvider(String)

在所指定根目錄上初始化 PhysicalFileProvider 的新執行個體。

PhysicalFileProvider(String, ExclusionFilters)

在所指定根目錄上初始化 PhysicalFileProvider 的新執行個體。

屬性

Root

此執行個體的根目錄。

UseActivePolling

取得或設定值,這個值可判斷此 PhysicalFileProvider 執行個體是否會主動輪詢檔案變更。

true 時,Watch(String) 所傳回的 IChangeToken 會主動輪詢檔案變更 (ActiveChangeCallbackstrue),而不是被動。

只有在設定了 UsePollingFileWatcher 時,這個屬性才有效。

UsePollingFileWatcher

取得或設定值,這個值可判斷此 PhysicalFileProvider 執行個體是否會使用輪詢來判定檔案變更。

根據預設,PhysicalFileProvider 會使用 FileSystemWatcher,來為 Watch(String) 接聽檔案變更事件。 FileSystemWatcher 在某些狀況下 (例如掛接的磁碟機) 不正確。 需要輪詢才能有效地監看檔案變更。

方法

Dispose()

處置提供者。 處置提供者之後,可能不會觸發變更權杖。

Dispose(Boolean)

處置提供者。

Equals(Object)

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
Finalize()

PhysicalFileProvider 的解構函式。

GetDirectoryContents(String)

列舉指定路徑上的目錄 (若有的話)。

GetFileInfo(String)

直接將路徑區段對應至實體目錄,在指定的路徑上尋找檔案。

GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetType()

取得目前執行個體的 Type

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。

(繼承來源 Object)
Watch(String)

為指定的 filter 建立 IChangeToken

萬用字元模式會由 Matcher 轉譯。

適用於