共用方式為


StaticFileExtensions.UseStaticFiles 方法

定義

多載

UseStaticFiles(IApplicationBuilder)

啟用目前要求路徑的靜態檔案服務

UseStaticFiles(IApplicationBuilder, StaticFileOptions)

使用給定的選項啟用靜態檔案提供

UseStaticFiles(IApplicationBuilder, String)

啟用指定要求路徑的靜態檔案服務

UseStaticFiles(IApplicationBuilder)

來源:
StaticFileExtensions.cs
來源:
StaticFileExtensions.cs
來源:
StaticFileExtensions.cs

啟用目前要求路徑的靜態檔案服務

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

參數

傳回

備註

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

適用於

UseStaticFiles(IApplicationBuilder, StaticFileOptions)

來源:
StaticFileExtensions.cs
來源:
StaticFileExtensions.cs
來源:
StaticFileExtensions.cs

使用給定的選項啟用靜態檔案提供

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

參數

傳回

適用於

UseStaticFiles(IApplicationBuilder, String)

來源:
StaticFileExtensions.cs
來源:
StaticFileExtensions.cs
來源:
StaticFileExtensions.cs

啟用指定要求路徑的靜態檔案服務

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

參數

requestPath
String

相對要求路徑。

傳回

備註

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

適用於