StaticFileOptions 類別

定義

提供靜態檔案的選項

public ref class StaticFileOptions : Microsoft::AspNetCore::StaticFiles::Infrastructure::SharedOptionsBase
public class StaticFileOptions : Microsoft.AspNetCore.StaticFiles.Infrastructure.SharedOptionsBase
type StaticFileOptions = class
    inherit SharedOptionsBase
Public Class StaticFileOptions
Inherits SharedOptionsBase
繼承
StaticFileOptions

建構函式

StaticFileOptions()

預設為所有要求路徑

StaticFileOptions(SharedOptions)

預設為所有要求路徑

屬性

ContentTypeProvider

用以將檔案對應至內容類型。

DefaultContentType

ContentTypeProvider 無法決定時,要求的預設內容類型。 預設不提供,所以用戶端必須自行決定格式。 http://www.w3.org/Protocols/rfc2616/rfc2616-sec7.html#sec7

FileProvider

用來尋找資源的檔案系統

(繼承來源 SharedOptionsBase)
HttpsCompression

指出當回應壓縮中介軟體可用時,是否應該針對 HTTPS 要求壓縮檔案。 預設值是 Compress

OnPrepareResponse

在設定狀態碼和標頭之後和寫入主體之前呼叫。 這可用來新增或變更回應標頭。

OnPrepareResponseAsync

在設定狀態碼和標頭之後和寫入主體之前呼叫。 這可用來新增或變更回應標頭。

RedirectToAppendTrailingSlash

指出是否要重新導向以在路徑結尾新增尾端斜線。 相對資源連結可能需要此專案。

(繼承來源 SharedOptionsBase)
RequestPath

對應至靜態資源的相對要求路徑。 這會預設為網站根 '/'。

(繼承來源 SharedOptionsBase)
ServeUnknownFileTypes

如果檔案不是可辨識的內容類型,應該提供嗎? 預設:false。

SharedOptions

數個中介軟體元件通用的選項

(繼承來源 SharedOptionsBase)

適用於