PhysicalFileProvider 類別

定義

使用磁碟上檔案系統來查詢檔案。Looks up files using the on-disk file system.

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) 的呼叫將會使用 PollingFileChangeTokenWhen the environment variable "DOTNET_USE_POLLING_FILE_WATCHER" is set to "1" or "true", calls to Watch(String) will use PollingFileChangeToken.

建構函式

PhysicalFileProvider(String)

在所指定根目錄上初始化 PhysicalFileProvider 的新執行個體。Initializes a new instance of a PhysicalFileProvider at the given root directory.

PhysicalFileProvider(String, ExclusionFilters)

在所指定根目錄上初始化 PhysicalFileProvider 的新執行個體。Initializes a new instance of a PhysicalFileProvider at the given root directory.

屬性

Root

此執行個體的根目錄。The root directory for this instance.

UseActivePolling

取得或設定值,這個值可判斷此 PhysicalFileProvider 執行個體是否會主動輪詢檔案變更。Gets or sets a value that determines if this instance of PhysicalFileProvider actively polls for file changes.

若為 true,則 Watch(String) 傳回的 IChangeToken 會主動而非被動輪詢檔案變更 (ActiveChangeCallbacks 會是 true)。When true, IChangeToken returned by Watch(String) will actively poll for file changes (ActiveChangeCallbacks will be true) instead of being passive.

只有在設定了 UsePollingFileWatcher 時,這個屬性才有效。This property is only effective when UsePollingFileWatcher is set.

UsePollingFileWatcher

取得或設定值,這個值可判斷此 PhysicalFileProvider 執行個體是否會使用輪詢來判定檔案變更。Gets or sets a value that determines if this instance of PhysicalFileProvider uses polling to determine file changes.

根據預設,PhysicalFileProvider 會使用 FileSystemWatcher 來接聽 Watch(String) 的檔案變更事件。By default, PhysicalFileProvider uses FileSystemWatcher to listen to file change events for Watch(String). FileSystemWatcher 在某些狀況下 (例如掛接的磁碟機) 不正確。FileSystemWatcher is ineffective in some scenarios such as mounted drives. 需要輪詢才能有效地監看檔案變更。Polling is required to effectively watch for file changes.

執行個體時提供 SQL Server 登入。.

方法

Dispose()

處置提供者。Disposes the provider. 處置提供者之後,變更權杖可能不會觸發。Change tokens may not trigger after the provider is disposed.

Dispose(Boolean)

處置提供者。Disposes the provider.

Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
Finalize()

PhysicalFileProvider 的解構函式。Destructor for PhysicalFileProvider.

GetDirectoryContents(String)

列舉指定路徑上的目錄 (若有的話)。Enumerate a directory at the given path, if any.

GetFileInfo(String)

直接將路徑區段對應至實體目錄,在指定的路徑上尋找檔案。Locate a file at the given path by directly mapping path segments to physical directories.

GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(繼承來源 Object)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)
Watch(String)

為指定的 filter 建立 IChangeTokenCreates a IChangeToken for the specified filter.

萬用字元模式的解譯方式Globbing patterns are interpreted by 執行個體時提供 SQL Server 登入。.

適用於