Bearbeiten

Freigeben über


HttpUtility.UrlDecodeToBytes Method

Definition

Converts a URL-encoded string or byte array into a decoded array of bytes.

To encode or decode values outside of a web application, use the WebUtility class.

Overloads

UrlDecodeToBytes(Byte[])

Converts a URL-encoded array of bytes into a decoded array of bytes.

UrlDecodeToBytes(String)

Converts a URL-encoded string into a decoded array of bytes.

UrlDecodeToBytes(String, Encoding)

Converts a URL-encoded string into a decoded array of bytes using the specified decoding object.

UrlDecodeToBytes(Byte[], Int32, Int32)

Converts a URL-encoded array of bytes into a decoded array of bytes, starting at the specified position in the array and continuing for the specified number of bytes.

UrlDecodeToBytes(Byte[])

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

Converts a URL-encoded array of bytes into a decoded array of bytes.

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()

Parameters

bytes
Byte[]

The array of bytes to decode.

Returns

Byte[]

A decoded array of bytes.

Remarks

If characters such as blanks and punctuation are passed in an HTTP stream, they might be misinterpreted at the receiving end. URL encoding converts characters that are not allowed in a URL into character-entity equivalents; URL decoding reverses the encoding. For example, when embedded in a block of text to be transmitted in a URL, the characters < and > are encoded as %3c and %3e.

To encode or decode values outside of a web application, use the WebUtility class.

See also

Applies to

UrlDecodeToBytes(String)

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

Converts a URL-encoded string into a decoded array of bytes.

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()

Parameters

str
String

The string to decode.

Returns

Byte[]

A decoded array of bytes.

Remarks

If characters such as blanks and punctuation are passed in an HTTP stream, they might be misinterpreted at the receiving end. URL encoding converts characters that are not allowed in a URL into character-entity equivalents; URL decoding reverses the encoding. For example, when embedded in a block of text to be transmitted in a URL, the characters < and > are encoded as %3c and %3e.

To encode or decode values outside of a web application, use the WebUtility class.

See also

Applies to

UrlDecodeToBytes(String, Encoding)

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

Converts a URL-encoded string into a decoded array of bytes using the specified decoding object.

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()

Parameters

str
String

The string to decode.

e
Encoding

The Encoding object that specifies the decoding scheme.

Returns

Byte[]

A decoded array of bytes.

Remarks

If characters such as blanks and punctuation are passed in an HTTP stream, they might be misinterpreted at the receiving end. URL encoding converts characters that are not allowed in a URL into character-entity equivalents; URL decoding reverses the encoding. For example, when embedded in a block of text to be transmitted in a URL, the characters < and > are encoded as %3c and %3e.

To encode or decode values outside of a web application, use the WebUtility class.

See also

Applies to

UrlDecodeToBytes(Byte[], Int32, Int32)

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

Converts a URL-encoded array of bytes into a decoded array of bytes, starting at the specified position in the array and continuing for the specified number of bytes.

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()

Parameters

bytes
Byte[]

The array of bytes to decode.

offset
Int32

The position in the byte array at which to begin decoding.

count
Int32

The number of bytes to decode.

Returns

Byte[]

A decoded array of bytes.

Exceptions

bytes is null, but count does not equal 0.

offset is less than 0 or greater than the length of the bytes array.

-or-

count is less than 0, or count + offset is greater than the length of the bytes array.

Remarks

If characters such as blanks and punctuation are passed in an HTTP stream, they might be misinterpreted at the receiving end. URL encoding converts characters that are not allowed in a URL into character-entity equivalents; URL decoding reverses the encoding. For example, when embedded in a block of text to be transmitted in a URL, the characters < and > are encoded as %3c and %3e.

To encode or decode values outside of a web application, use the WebUtility class.

See also

Applies to