共用方式為


AsnReader.TryReadPrimitiveCharacterStringBytes 方法

定義

讀取下一個值做為具有所指定標籤的字元,同時透過原始資料傳回內容做為未處理的 ReadOnlyMemory<T>

public:
 bool TryReadPrimitiveCharacterStringBytes(System::Formats::Asn1::Asn1Tag expectedTag, [Runtime::InteropServices::Out] ReadOnlyMemory<System::Byte> % contents);
public bool TryReadPrimitiveCharacterStringBytes (System.Formats.Asn1.Asn1Tag expectedTag, out ReadOnlyMemory<byte> contents);
member this.TryReadPrimitiveCharacterStringBytes : System.Formats.Asn1.Asn1Tag * ReadOnlyMemory -> bool
Public Function TryReadPrimitiveCharacterStringBytes (expectedTag As Asn1Tag, ByRef contents As ReadOnlyMemory(Of Byte)) As Boolean

參數

expectedTag
Asn1Tag

要在讀取之前檢查的標籤。

contents
ReadOnlyMemory<Byte>

成功時,會透過原始資料收到對應於字元字串值的 ReadOnlyMemory<T>

傳回

如果字元字串值具有基本編碼,則為 true 並推進讀取器;如果具有結構化編碼,則為 false 且不會推進讀取器。

例外狀況

下一個值沒有正確的標記。

-或-

長度編碼在目前的編碼規則下無效。

-或-

內容在目前的編碼規則下無效。

expectedTagTagClassUniversal,但 expectedTagTagValue 不是字元字串標記類型。

備註

這個方法不會判斷字串是否只使用編碼所定義的字元。

適用於