Results.Bytes 方法

定義

多載

Bytes(Byte[], String, String, Boolean, Nullable<DateTimeOffset>, EntityTagHeaderValue)

將位元組陣列內容寫入回應。

這支援範圍要求 (Status206PartialContent ,或者 Status416RangeNotSatisfiable 範圍無法滿足) 。

此 API 是 的 File(Byte[], String, String, Boolean, Nullable<DateTimeOffset>, EntityTagHeaderValue) 別名。

Bytes(ReadOnlyMemory<Byte>, String, String, Boolean, Nullable<DateTimeOffset>, EntityTagHeaderValue)

將位元組陣列內容寫入回應。

這支援範圍要求 (Status206PartialContent ,或者 Status416RangeNotSatisfiable 範圍無法滿足) 。

Bytes(Byte[], String, String, Boolean, Nullable<DateTimeOffset>, EntityTagHeaderValue)

將位元組陣列內容寫入回應。

這支援範圍要求 (Status206PartialContent ,或者 Status416RangeNotSatisfiable 範圍無法滿足) 。

此 API 是 的 File(Byte[], String, String, Boolean, Nullable<DateTimeOffset>, EntityTagHeaderValue) 別名。

public static Microsoft.AspNetCore.Http.IResult Bytes (byte[] contents, string? contentType = default, string? fileDownloadName = default, bool enableRangeProcessing = false, DateTimeOffset? lastModified = default, Microsoft.Net.Http.Headers.EntityTagHeaderValue? entityTag = default);
static member Bytes : byte[] * string * string * bool * Nullable<DateTimeOffset> * Microsoft.Net.Http.Headers.EntityTagHeaderValue -> Microsoft.AspNetCore.Http.IResult
Public Shared Function Bytes (contents As Byte(), Optional contentType As String = Nothing, Optional fileDownloadName As String = Nothing, Optional enableRangeProcessing As Boolean = false, Optional lastModified As Nullable(Of DateTimeOffset) = Nothing, Optional entityTag As EntityTagHeaderValue = Nothing) As IResult

參數

contents
Byte[]

檔案內容。

contentType
String

檔案的 Content-Type。

fileDownloadName
String

建議的檔案名。

enableRangeProcessing
Boolean

設定為 true 以啟用範圍要求處理。

lastModified
Nullable<DateTimeOffset>

DateTimeOffset上次修改檔案時的 。

entityTag
EntityTagHeaderValue

EntityTagHeaderValue與檔案相關聯的 。

傳回

為回應建立 IResult 的 。

適用於

Bytes(ReadOnlyMemory<Byte>, String, String, Boolean, Nullable<DateTimeOffset>, EntityTagHeaderValue)

將位元組陣列內容寫入回應。

這支援範圍要求 (Status206PartialContent ,或者 Status416RangeNotSatisfiable 範圍無法滿足) 。

public static Microsoft.AspNetCore.Http.IResult Bytes (ReadOnlyMemory<byte> contents, string? contentType = default, string? fileDownloadName = default, bool enableRangeProcessing = false, DateTimeOffset? lastModified = default, Microsoft.Net.Http.Headers.EntityTagHeaderValue? entityTag = default);
static member Bytes : ReadOnlyMemory<byte> * string * string * bool * Nullable<DateTimeOffset> * Microsoft.Net.Http.Headers.EntityTagHeaderValue -> Microsoft.AspNetCore.Http.IResult
Public Shared Function Bytes (contents As ReadOnlyMemory(Of Byte), Optional contentType As String = Nothing, Optional fileDownloadName As String = Nothing, Optional enableRangeProcessing As Boolean = false, Optional lastModified As Nullable(Of DateTimeOffset) = Nothing, Optional entityTag As EntityTagHeaderValue = Nothing) As IResult

參數

contents
ReadOnlyMemory<Byte>

檔案內容。

contentType
String

檔案的 Content-Type。

fileDownloadName
String

建議的檔案名。

enableRangeProcessing
Boolean

設定為 true 以啟用範圍要求處理。

lastModified
Nullable<DateTimeOffset>

DateTimeOffset上次修改檔案時的 。

entityTag
EntityTagHeaderValue

EntityTagHeaderValue與檔案相關聯的 。

傳回

為回應建立 IResult 的 。

適用於