共用方式為


HttpMultipartFormDataContent 類別

定義

提供使用 multipart/form-data MIME 類型的 HTTP 內容。

public ref class HttpMultipartFormDataContent sealed : IIterable<IHttpContent ^>, IClosable, IStringable, IHttpContent
/// [Windows.Foundation.Metadata.Activatable(Windows.Web.Http.IHttpMultipartFormDataContentFactory, 65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.Activatable(65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class HttpMultipartFormDataContent final : IIterable<IHttpContent>, IClosable, IStringable, IHttpContent
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
/// [Windows.Foundation.Metadata.Activatable(Windows.Web.Http.IHttpMultipartFormDataContentFactory, 65536, "Windows.Foundation.UniversalApiContract")]
class HttpMultipartFormDataContent final : IIterable<IHttpContent>, IClosable, IStringable, IHttpContent
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Web.Http.IHttpMultipartFormDataContentFactory), 65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.Activatable(65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class HttpMultipartFormDataContent : IEnumerable<IHttpContent>, System.IDisposable, IStringable, IHttpContent
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Web.Http.IHttpMultipartFormDataContentFactory), 65536, "Windows.Foundation.UniversalApiContract")]
public sealed class HttpMultipartFormDataContent : IEnumerable<IHttpContent>, System.IDisposable, IStringable, IHttpContent
function HttpMultipartFormDataContent(boundary)
Public NotInheritable Class HttpMultipartFormDataContent
Implements IDisposable, IEnumerable(Of IHttpContent), IHttpContent, IStringable
繼承
Object Platform::Object IInspectable HttpMultipartFormDataContent
屬性
實作

Windows 需求

裝置系列
Windows 10 (已於 10.0.10240.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v1.0 引進)

備註

列舉 C# 或 Microsoft Visual Basic 中的集合

您可以在 C# 或 Microsoft Visual Basic 中逐一查看 HttpMultipartFormDataContent 物件。 在許多情況下,例如使用 foreach 語法,編譯程式會為您執行此轉換,而且您不需要明確地轉換成 IEnumerable<IHttpContent> 。 如果您需要明確轉換,例如,如果您想要呼叫 GetEnumerator,請轉換成 [IEnumerable< T>] (/dotnet/api/system.collections.generic.ienumerable-1?view=dotnet-uwp-10.0&preserve-view=true 搭配 IHttpContent 条件約束。

建構函式

HttpMultipartFormDataContent()

初始化 HttpMultipartFormDataContent 類別的新實例。

HttpMultipartFormDataContent(String)

使用指定的界限字串,初始化 HttpMultipartFormDataContent 類別的新實例。

屬性

Headers

取得 在 HttpMultipartFormDataContent 上設定的內容標頭集合。

方法

Add(IHttpContent)

將 HTTP 內容新增至 HttpMultipartFormDataContent 實例。

Add(IHttpContent, String)

將具有指定名稱的 HTTP 內容新增至 HttpMultipartFormDataContent 實例。

Add(IHttpContent, String, String)

將具有指定名稱的 HTTP 內容從檔案新增至 HttpMultipartFormDataContent 實例。

BufferAllAsync()

HttpMultipartFormDataContent 串行化為異步操作的記憶體。

Close()

關閉 HttpMultipartFormDataContent 實例,並釋放已配置的資源。

Dispose()

執行與釋放 (Free)、釋放 (Release) 或重設 Unmanaged 資源相關聯之應用程式定義的工作。

First()

取得 對象,這個物件可用來列舉 HttpMultipartFormDataContent 對象中的內容。

ReadAsBufferAsync()

HttpMultipartFormDataContent 串行化為異步操作的緩衝區。

ReadAsInputStreamAsync()

串行化 HttpMultipartFormDataContent ,並傳回以異步操作表示內容的輸入數據流。

ReadAsStringAsync()

HttpMultipartFormDataContent 串行化為 字串 做為異步操作。

ToString()

會傳回代表目前 HttpMultipartFormDataContent 物件的字串。

TryComputeLength(UInt64)

判斷 HttpMultipartFormDataContent 是否具有位元組的有效長度。

WriteToStreamAsync(IOutputStream)

HttpMultipartFormDataContent 寫入輸出數據流作為異步操作。

適用於

另請參閱