HttpServerUtility.UrlTokenEncode(Byte[]) HttpServerUtility.UrlTokenEncode(Byte[]) HttpServerUtility.UrlTokenEncode(Byte[]) HttpServerUtility.UrlTokenEncode(Byte[]) Method

定義

將位元組陣列編碼成其對等的字串表示,該字串使用 Base 64 數字且可在 URL 上傳輸。Encodes a byte array into its equivalent string representation using base 64 digits, which is usable for transmission on the URL.

public:
 static System::String ^ UrlTokenEncode(cli::array <System::Byte> ^ input);
public static string UrlTokenEncode (byte[] input);
static member UrlTokenEncode : byte[] -> string
Public Shared Function UrlTokenEncode (input As Byte()) As String

參數

input
Byte[]

要編碼的位元組陣列。The byte array to encode.

傳回

如果位元組陣列 length 大於一,則為包含已編碼語彙基元的字串;否則為空字串 ("")。The string containing the encoded token if the byte array length is greater than one; otherwise, an empty string ("").

例外狀況

input 參數的值為 nullThe value of the input parameter is null.

備註

UrlTokenEncode方法會將位元組陣列轉換成編碼為 base 64 數字相等的字串表示。The UrlTokenEncode method converts a byte array into an equivalent string representation encoded with base 64 digits. 可以在 URL 上傳輸產生的字串語彙基元。The resulting string token can be transmitted on the URL.

UrlTokenEncode會傳回空字串,如果input參數的長度小於 1。The UrlTokenEncode will return an empty string if the input parameter has a length of less than one.

適用於

另請參閱