HttpUtility.UrlDecodeToBytes 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
将 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
- 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[]
要解码的字节数组。
返回
解码的字节数组。
注解
如果在 HTTP 流中传递空白和标点符号等字符,则它们可能会在接收端被误解。 URL 编码将 URL 中不允许的字符转换为字符实体等效项;URL 解码会反转编码。 例如,当嵌入在 URL 中传输的文本块中时,字符 < 和 > 编码为 %3c 和 %3e。
若要对 Web 应用程序外部的值进行编码或解码,请使用类 WebUtility 。
另请参阅
适用于
UrlDecodeToBytes(String)
- Source:
- HttpUtility.cs
- Source:
- HttpUtility.cs
- 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
要解码的字符串。
返回
解码的字节数组。
注解
如果在 HTTP 流中传递空白和标点符号等字符,则它们可能会在接收端被误解。 URL 编码将 URL 中不允许的字符转换为字符实体等效项;URL 解码会反转编码。 例如,当嵌入在 URL 中传输的文本块中时,字符 < 和 > 编码为 %3c 和 %3e。
若要对 Web 应用程序外部的值进行编码或解码,请使用类 WebUtility 。
另请参阅
适用于
UrlDecodeToBytes(String, Encoding)
- Source:
- HttpUtility.cs
- Source:
- HttpUtility.cs
- 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
要解码的字符串。
返回
解码的字节数组。
注解
如果在 HTTP 流中传递空白和标点符号等字符,则它们可能会在接收端被误解。 URL 编码将 URL 中不允许的字符转换为字符实体等效项;URL 解码会反转编码。 例如,当嵌入在 URL 中传输的文本块中时,字符 < 和 > 编码为 %3c 和 %3e。
若要对 Web 应用程序外部的值进行编码或解码,请使用类 WebUtility 。
另请参阅
适用于
UrlDecodeToBytes(Byte[], Int32, Int32)
- Source:
- HttpUtility.cs
- Source:
- HttpUtility.cs
- 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
要解码的字节数。
返回
解码的字节数组。
例外
bytes 是 null,但不 count 等于 0。
注解
如果在 HTTP 流中传递空白和标点符号等字符,则它们可能会在接收端被误解。 URL 编码将 URL 中不允许的字符转换为字符实体等效项;URL 解码会反转编码。 例如,当嵌入在 URL 中传输的文本块中时,字符 < 和 > 编码为 %3c 和 %3e。
若要对 Web 应用程序外部的值进行编码或解码,请使用类 WebUtility 。