CryptographicBuffer.EncodeToHexString(IBuffer) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
將緩衝區編碼為十六進位字串。
public:
static Platform::String ^ EncodeToHexString(IBuffer ^ buffer);
static winrt::hstring EncodeToHexString(IBuffer const& buffer);
public static string EncodeToHexString(IBuffer buffer);
function encodeToHexString(buffer)
Public Shared Function EncodeToHexString (buffer As IBuffer) As String
參數
- buffer
- IBuffer
輸入緩衝區。
傳回
十六進位編碼輸出字串。
範例
public void EncodeDecodeHex()
{
// Define a hexadecimal string.
String strHex = "30310AFF";
// Decode a hexadecimal string to binary.
IBuffer buffer = CryptographicBuffer.DecodeFromHexString(strHex);
// Encode the buffer back into a hexadecimal string.
String strHexNew = CryptographicBuffer.EncodeToHexString(buffer);
}