共用方式為


CryptographicBuffer.DecodeFromHexString(String) 方法

定義

解碼已編碼十六進位的字串。

public:
 static IBuffer ^ DecodeFromHexString(Platform::String ^ value);
 static IBuffer DecodeFromHexString(winrt::hstring const& value);
public static IBuffer DecodeFromHexString(string value);
function decodeFromHexString(value)
Public Shared Function DecodeFromHexString (value As String) As IBuffer

參數

value
String

Platform::String

winrt::hstring

編碼的輸入字串。

傳回

包含解碼字串的輸出緩衝區。

範例

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);
}

適用於