XmlReader.ReadElementContentAsBinHexAsync(Byte[], Int32, Int32) 方法

定義

以非同步的方式讀取項目,並將 BinHex 內容解碼。

C#
public virtual System.Threading.Tasks.Task<int> ReadElementContentAsBinHexAsync (byte[] buffer, int index, int count);

參數

buffer
Byte[]

將產生的文字複製到其中的緩衝區。 這個值不能是 null

index
Int32

緩衝區中開始複製結果的位移。

count
Int32

要複製至緩衝區中的最大位元組數目。 從這個方法傳回所複製的實際位元組數目。

傳回

寫入緩衝區的位元組數目。

例外狀況

在先前的非同步作業完成前呼叫了 XmlReader 方法。 在此情況下,會擲回 InvalidOperationException 與「非同步作業已經在進行中」的訊息。

-或-

在未將 Async 旗標設為 true的情況下呼叫了 XmlReader 非同步方法。 在此情況下,會擲回 InvalidOperationException 與「如果您想要使用非同步方法,請將 XmlReaderSettings.Async 設為 true」的訊息。

備註

這是 的非同步版本 ReadElementContentAsBinHex ,具有相同的功能。 若要使用這個方法,您必須將 Async 旗標設定為 true

適用於

產品 版本
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.0, 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1
UWP 10.0

另請參閱