HttpUtility.UrlDecodeToBytes 方法

定義

將 URL 編碼的字串或位元組陣列轉換成解碼的位元組陣列。

若要編碼或解碼 Web 應用程式之外的值,請使用 WebUtility 類別。

多載

UrlDecodeToBytes(Byte[])

將 URL 編碼的位元組陣列轉換成已解碼的位元組陣列。

UrlDecodeToBytes(String)

將 URL 編碼的字串轉換成解碼的位元組陣列。

UrlDecodeToBytes(String, Encoding)

使用指定的解碼物件將 URL 編碼的字串轉換成已解碼的位元組陣列。

UrlDecodeToBytes(Byte[], Int32, Int32)

將 URL 編碼的位元組陣列轉換成已解碼的位元組陣列,起點在陣列中的指定位置,延續至指定的位元組數目。

UrlDecodeToBytes(Byte[])

Source:
HttpUtility.cs
Source:
HttpUtility.cs
Source:
HttpUtility.cs

將 URL 編碼的位元組陣列轉換成已解碼的位元組陣列。

public:
 static cli::array <System::Byte> ^ UrlDecodeToBytes(cli::array <System::Byte> ^ bytes);
public static byte[]? UrlDecodeToBytes (byte[]? bytes);
public static byte[] UrlDecodeToBytes (byte[] bytes);
static member UrlDecodeToBytes : byte[] -> byte[]
Public Shared Function UrlDecodeToBytes (bytes As Byte()) As Byte()

參數

bytes
Byte[]

要解碼的位元組陣列。

傳回

Byte[]

已解碼的位元組陣列。

備註

如果在 HTTP 資料流程中傳遞空白和標點符號之類的字元,在接收端可能會誤譯這些字元。 URL 編碼會將 URL 中不允許的字元轉換成字元實體對等專案;URL 解碼會反轉編碼。 例如,當內嵌在 URL 中傳輸的文字區塊時,字元 < 和 > 會編碼為 %3c 和 %3e。

若要編碼或解碼 Web 應用程式之外的值,請使用 WebUtility 類別。

另請參閱

適用於

UrlDecodeToBytes(String)

Source:
HttpUtility.cs
Source:
HttpUtility.cs
Source:
HttpUtility.cs

將 URL 編碼的字串轉換成解碼的位元組陣列。

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

參數

str
String

要解碼的字串。

傳回

Byte[]

已解碼的位元組陣列。

備註

如果在 HTTP 資料流程中傳遞空白和標點符號之類的字元,在接收端可能會誤譯這些字元。 URL 編碼會將 URL 中不允許的字元轉換成字元實體對等專案;URL 解碼會反轉編碼。 例如,當內嵌在 URL 中傳輸的文字區塊時,字元 < 和 > 會編碼為 %3c 和 %3e。

若要編碼或解碼 Web 應用程式之外的值,請使用 WebUtility 類別。

另請參閱

適用於

UrlDecodeToBytes(String, Encoding)

Source:
HttpUtility.cs
Source:
HttpUtility.cs
Source:
HttpUtility.cs

使用指定的解碼物件將 URL 編碼的字串轉換成已解碼的位元組陣列。

public:
 static cli::array <System::Byte> ^ UrlDecodeToBytes(System::String ^ str, System::Text::Encoding ^ e);
public static byte[]? UrlDecodeToBytes (string? str, System.Text.Encoding e);
public static byte[] UrlDecodeToBytes (string str, System.Text.Encoding e);
static member UrlDecodeToBytes : string * System.Text.Encoding -> byte[]
Public Shared Function UrlDecodeToBytes (str As String, e As Encoding) As Byte()

參數

str
String

要解碼的字串。

e
Encoding

Encoding 物件,指定解碼配置。

傳回

Byte[]

已解碼的位元組陣列。

備註

如果在 HTTP 資料流程中傳遞空白和標點符號之類的字元,在接收端可能會誤譯這些字元。 URL 編碼會將 URL 中不允許的字元轉換成字元實體對等專案;URL 解碼會反轉編碼。 例如,當內嵌在 URL 中傳輸的文字區塊時,字元 < 和 > 會編碼為 %3c 和 %3e。

若要編碼或解碼 Web 應用程式之外的值,請使用 WebUtility 類別。

另請參閱

適用於

UrlDecodeToBytes(Byte[], Int32, Int32)

Source:
HttpUtility.cs
Source:
HttpUtility.cs
Source:
HttpUtility.cs

將 URL 編碼的位元組陣列轉換成已解碼的位元組陣列,起點在陣列中的指定位置,延續至指定的位元組數目。

public:
 static cli::array <System::Byte> ^ UrlDecodeToBytes(cli::array <System::Byte> ^ bytes, int offset, int count);
public static byte[]? UrlDecodeToBytes (byte[]? bytes, int offset, int count);
public static byte[] UrlDecodeToBytes (byte[] bytes, int offset, int count);
static member UrlDecodeToBytes : byte[] * int * int -> byte[]
Public Shared Function UrlDecodeToBytes (bytes As Byte(), offset As Integer, count As Integer) As Byte()

參數

bytes
Byte[]

要解碼的位元組陣列。

offset
Int32

位元組陣列中要開始解碼的位置。

count
Int32

要解碼的位元組數。

傳回

Byte[]

已解碼的位元組陣列。

例外狀況

bytesnull,但 count 不等於 0

offset 小於 0 或大於 bytes 陣列的長度。

-或-

count 小於 0,或 count + offset 大於 bytes 陣列的長度。

備註

如果在 HTTP 資料流程中傳遞空白和標點符號之類的字元,在接收端可能會誤譯這些字元。 URL 編碼會將 URL 中不允許的字元轉換成字元實體對等專案;URL 解碼會反轉編碼。 例如,當內嵌在 URL 中傳輸的文字區塊時,字元 < 和 > 會編碼為 %3c 和 %3e。

若要編碼或解碼 Web 應用程式之外的值,請使用 WebUtility 類別。

另請參閱

適用於