共用方式為


FileServerExtensions.UseFileServer 方法

定義

多載

UseFileServer(IApplicationBuilder)

對目前目錄中的目前要求路徑啟用所有靜態檔案中介軟體 (目錄瀏覽除外)。

UseFileServer(IApplicationBuilder, FileServerOptions)

使用給定的選項啟用所有靜態檔案中介軟體

UseFileServer(IApplicationBuilder, Boolean)

對目前目錄中的目前要求路徑啟用所有靜態檔案中介軟體。

UseFileServer(IApplicationBuilder, String)

對同名的目錄中給定的要求路徑啟用所有靜態檔案中介軟體 (目錄瀏覽除外)

UseFileServer(IApplicationBuilder)

來源:
FileServerExtensions.cs
來源:
FileServerExtensions.cs
來源:
FileServerExtensions.cs

對目前目錄中的目前要求路徑啟用所有靜態檔案中介軟體 (目錄瀏覽除外)。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Builder::IApplicationBuilder ^ UseFileServer(Microsoft::AspNetCore::Builder::IApplicationBuilder ^ app);
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseFileServer (this Microsoft.AspNetCore.Builder.IApplicationBuilder app);
static member UseFileServer : Microsoft.AspNetCore.Builder.IApplicationBuilder -> Microsoft.AspNetCore.Builder.IApplicationBuilder
<Extension()>
Public Function UseFileServer (app As IApplicationBuilder) As IApplicationBuilder

參數

傳回

備註

檔案會從 中指定的 WebRootPath 路徑提供,或 WebRootFileProvider 預設為 'wwwroot' 子資料夾。

適用於

UseFileServer(IApplicationBuilder, FileServerOptions)

來源:
FileServerExtensions.cs
來源:
FileServerExtensions.cs
來源:
FileServerExtensions.cs

使用給定的選項啟用所有靜態檔案中介軟體

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Builder::IApplicationBuilder ^ UseFileServer(Microsoft::AspNetCore::Builder::IApplicationBuilder ^ app, Microsoft::AspNetCore::Builder::FileServerOptions ^ options);
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseFileServer (this Microsoft.AspNetCore.Builder.IApplicationBuilder app, Microsoft.AspNetCore.Builder.FileServerOptions options);
static member UseFileServer : Microsoft.AspNetCore.Builder.IApplicationBuilder * Microsoft.AspNetCore.Builder.FileServerOptions -> Microsoft.AspNetCore.Builder.IApplicationBuilder
<Extension()>
Public Function UseFileServer (app As IApplicationBuilder, options As FileServerOptions) As IApplicationBuilder

參數

傳回

適用於

UseFileServer(IApplicationBuilder, Boolean)

來源:
FileServerExtensions.cs
來源:
FileServerExtensions.cs
來源:
FileServerExtensions.cs

對目前目錄中的目前要求路徑啟用所有靜態檔案中介軟體。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Builder::IApplicationBuilder ^ UseFileServer(Microsoft::AspNetCore::Builder::IApplicationBuilder ^ app, bool enableDirectoryBrowsing);
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseFileServer (this Microsoft.AspNetCore.Builder.IApplicationBuilder app, bool enableDirectoryBrowsing);
static member UseFileServer : Microsoft.AspNetCore.Builder.IApplicationBuilder * bool -> Microsoft.AspNetCore.Builder.IApplicationBuilder
<Extension()>
Public Function UseFileServer (app As IApplicationBuilder, enableDirectoryBrowsing As Boolean) As IApplicationBuilder

參數

enableDirectoryBrowsing
Boolean

應該啟用目錄瀏覽嗎?

傳回

備註

檔案會從 中指定的 WebRootPath 路徑提供,或 WebRootFileProvider 預設為 'wwwroot' 子資料夾。

適用於

UseFileServer(IApplicationBuilder, String)

來源:
FileServerExtensions.cs
來源:
FileServerExtensions.cs
來源:
FileServerExtensions.cs

對同名的目錄中給定的要求路徑啟用所有靜態檔案中介軟體 (目錄瀏覽除外)

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Builder::IApplicationBuilder ^ UseFileServer(Microsoft::AspNetCore::Builder::IApplicationBuilder ^ app, System::String ^ requestPath);
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseFileServer (this Microsoft.AspNetCore.Builder.IApplicationBuilder app, string requestPath);
static member UseFileServer : Microsoft.AspNetCore.Builder.IApplicationBuilder * string -> Microsoft.AspNetCore.Builder.IApplicationBuilder
<Extension()>
Public Function UseFileServer (app As IApplicationBuilder, requestPath As String) As IApplicationBuilder

參數

requestPath
String

相對要求路徑。

傳回

備註

檔案會從 中指定的 WebRootPath 路徑提供,或 WebRootFileProvider 預設為 'wwwroot' 子資料夾。

適用於