FileServerExtensions.UseFileServer 方法

定义

重载

UseFileServer(IApplicationBuilder)

为当前目录中的当前请求路径启用所有静态文件中间件(目录浏览除外)。

UseFileServer(IApplicationBuilder, FileServerOptions)

使用给定的选项启用所有静态文件中间件

UseFileServer(IApplicationBuilder, Boolean)

为当前目录中的当前请求路径启用所有静态文件中间件。

UseFileServer(IApplicationBuilder, String)

为同名目录中的给定请求路径启用所有静态文件中间件(目录浏览除外)

UseFileServer(IApplicationBuilder)

Source:
FileServerExtensions.cs
Source:
FileServerExtensions.cs
Source:
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

参数

返回

注解

文件从 或 WebRootFileProvider 中指定的WebRootPath路径提供,默认为“wwwroot”子文件夹。

适用于

UseFileServer(IApplicationBuilder, FileServerOptions)

Source:
FileServerExtensions.cs
Source:
FileServerExtensions.cs
Source:
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)

Source:
FileServerExtensions.cs
Source:
FileServerExtensions.cs
Source:
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

是否应启用目录浏览?

返回

注解

文件从 或 WebRootFileProvider 中指定的WebRootPath路径提供,默认为“wwwroot”子文件夹。

适用于

UseFileServer(IApplicationBuilder, String)

Source:
FileServerExtensions.cs
Source:
FileServerExtensions.cs
Source:
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

相对请求路径。

返回

注解

文件从 或 WebRootFileProvider 中指定的WebRootPath路径提供,默认为“wwwroot”子文件夹。

适用于