gpt4 book ai didi

c# - .NET Core 中的 WebUtility.HtmlDecode 替换

转载 作者:IT王子 更新时间:2023-10-29 03:43:04 37 4
gpt4 key购买 nike

我需要在 .NET Core (MVC6) 中解码 HTML 字符。看起来 .NET Core 没有 WebUtility.HtmlDecode 函数,之前每个人都为此目的使用过该函数。 .NET Core 中是否存在替代品?

最佳答案

这是在System.Net.WebUtility类(自 .NET Standard 1.0 起):

//
// Summary:
// Provides methods for encoding and decoding URLs when processing Web requests.
public static class WebUtility
{
public static string HtmlDecode(string value);
public static string HtmlEncode(string value);
public static string UrlDecode(string encodedValue);
public static byte[] UrlDecodeToBytes(byte[] encodedValue, int offset, int count);
public static string UrlEncode(string value);
public static byte[] UrlEncodeToBytes(byte[] value, int offset, int count);
}

关于c# - .NET Core 中的 WebUtility.HtmlDecode 替换,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35437491/

37 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com