WebUtility.HtmlDecode 方法

定义

将已经为 HTTP 传输进行过 HTML 编码的字符串转换为已解码的字符串。

重载

HtmlDecode(String)

将已经为 HTTP 传输进行过 HTML 编码的字符串转换为已解码的字符串。

HtmlDecode(String, TextWriter)

将已经过 HTML 编码的字符串转换为已解码的字符串并将其发送给 TextWriter 输出流。

HtmlDecode(String)

Source:
WebUtility.cs
Source:
WebUtility.cs
Source:
WebUtility.cs

将已经为 HTTP 传输进行过 HTML 编码的字符串转换为已解码的字符串。

public:
 static System::String ^ HtmlDecode(System::String ^ value);
public static string HtmlDecode (string value);
public static string? HtmlDecode (string? value);
static member HtmlDecode : string -> string
Public Shared Function HtmlDecode (value As String) As String

参数

value
String

要解码的字符串。

返回

已解码的字符串。

注解

如果在 HTTP 流中传递空格和标点符号等字符,则可能在接收端被错误解释。 HTML 编码将 HTML 中不允许的字符转换为字符实体等效项;HTML 解码会反转编码。 例如,当嵌入到文本块中时,字符 <> 将编码为 &lt;&gt; 以用于 HTTP 传输。

value如果 参数为 null,则返回的解码字符串为 nullvalue如果 参数为空字符串,则返回的解码字符串为空字符串。

另请参阅

适用于

HtmlDecode(String, TextWriter)

Source:
WebUtility.cs
Source:
WebUtility.cs
Source:
WebUtility.cs

将已经过 HTML 编码的字符串转换为已解码的字符串并将其发送给 TextWriter 输出流。

public:
 static void HtmlDecode(System::String ^ value, System::IO::TextWriter ^ output);
public static void HtmlDecode (string? value, System.IO.TextWriter output);
public static void HtmlDecode (string value, System.IO.TextWriter output);
static member HtmlDecode : string * System.IO.TextWriter -> unit
Public Shared Sub HtmlDecode (value As String, output As TextWriter)

参数

value
String

要解码的字符串。

output
TextWriter

TextWriter 输出流。

例外

如果 output 参数不为 null,则 value 参数不能为 null

注解

如果在 HTTP 流中传递空格和标点符号等字符,则可能在接收端被错误解释。 HTML 编码将 HTML 中不允许的字符转换为字符实体等效项;HTML 解码会反转编码。 例如,当嵌入到文本块中时,字符 <> 将编码为 &lt;&gt; 以用于 HTTP 传输。

另请参阅

适用于