SendFileResponseExtensions.SendFileAsync 方法

定义

重载

SendFileAsync(HttpResponse, IFileInfo, CancellationToken)

使用 SendFile 扩展发送给定的文件。

SendFileAsync(HttpResponse, String, CancellationToken)

使用 SendFile 扩展发送给定的文件。

SendFileAsync(HttpResponse, IFileInfo, Int64, Nullable<Int64>, CancellationToken)

使用 SendFile 扩展发送给定的文件。

SendFileAsync(HttpResponse, String, Int64, Nullable<Int64>, CancellationToken)

使用 SendFile 扩展发送给定的文件。

SendFileAsync(HttpResponse, IFileInfo, CancellationToken)

使用 SendFile 扩展发送给定的文件。

public static System.Threading.Tasks.Task SendFileAsync (this Microsoft.AspNetCore.Http.HttpResponse response, Microsoft.Extensions.FileProviders.IFileInfo file, System.Threading.CancellationToken cancellationToken = default);
static member SendFileAsync : Microsoft.AspNetCore.Http.HttpResponse * Microsoft.Extensions.FileProviders.IFileInfo * System.Threading.CancellationToken -> System.Threading.Tasks.Task
<Extension()>
Public Function SendFileAsync (response As HttpResponse, file As IFileInfo, Optional cancellationToken As CancellationToken = Nothing) As Task

参数

response
HttpResponse
file
IFileInfo

文件。

cancellationToken
CancellationToken

CancellationToken

返回

适用于

SendFileAsync(HttpResponse, String, CancellationToken)

使用 SendFile 扩展发送给定的文件。

public static System.Threading.Tasks.Task SendFileAsync (this Microsoft.AspNetCore.Http.HttpResponse response, string fileName, System.Threading.CancellationToken cancellationToken = default);
static member SendFileAsync : Microsoft.AspNetCore.Http.HttpResponse * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task
<Extension()>
Public Function SendFileAsync (response As HttpResponse, fileName As String, Optional cancellationToken As CancellationToken = Nothing) As Task

参数

response
HttpResponse
fileName
String

文件的完整路径。

cancellationToken
CancellationToken

CancellationToken

返回

适用于

SendFileAsync(HttpResponse, IFileInfo, Int64, Nullable<Int64>, CancellationToken)

使用 SendFile 扩展发送给定的文件。

public static System.Threading.Tasks.Task SendFileAsync (this Microsoft.AspNetCore.Http.HttpResponse response, Microsoft.Extensions.FileProviders.IFileInfo file, long offset, long? count, System.Threading.CancellationToken cancellationToken = default);
static member SendFileAsync : Microsoft.AspNetCore.Http.HttpResponse * Microsoft.Extensions.FileProviders.IFileInfo * int64 * Nullable<int64> * System.Threading.CancellationToken -> System.Threading.Tasks.Task
<Extension()>
Public Function SendFileAsync (response As HttpResponse, file As IFileInfo, offset As Long, count As Nullable(Of Long), Optional cancellationToken As CancellationToken = Nothing) As Task

参数

response
HttpResponse
file
IFileInfo

文件。

offset
Int64

文件中的偏移量。

count
Nullable<Int64>

要发送的字节数,或 null 表示发送文件的其余部分。

cancellationToken
CancellationToken

返回

适用于

SendFileAsync(HttpResponse, String, Int64, Nullable<Int64>, CancellationToken)

使用 SendFile 扩展发送给定的文件。

public static System.Threading.Tasks.Task SendFileAsync (this Microsoft.AspNetCore.Http.HttpResponse response, string fileName, long offset, long? count, System.Threading.CancellationToken cancellationToken = default);
static member SendFileAsync : Microsoft.AspNetCore.Http.HttpResponse * string * int64 * Nullable<int64> * System.Threading.CancellationToken -> System.Threading.Tasks.Task
<Extension()>
Public Function SendFileAsync (response As HttpResponse, fileName As String, offset As Long, count As Nullable(Of Long), Optional cancellationToken As CancellationToken = Nothing) As Task

参数

response
HttpResponse
fileName
String

文件的完整路径。

offset
Int64

文件中的偏移量。

count
Nullable<Int64>

要发送的字节数,或 null 表示发送文件的其余部分。

cancellationToken
CancellationToken

返回

适用于