在.NET中使用Server.HtmlDecode、Server.HtmlEncode就可进行解码与编码。
Core中的写法:
写法1:
using System.Web;
HttpUtility.HtmlDecode()
HttpUtility.HtmlEncode()
写法2:
using System.Text.Encodings.Web;
HtmlEncoder.Default.Encode()
HtmlEncoder.Default.Decode()
在.NET中使用Server.HtmlDecode、Server.HtmlEncode就可进行解码与编码。
Core中的写法:
写法1:
using System.Web;
HttpUtility.HtmlDecode()
HttpUtility.HtmlEncode()
写法2:
using System.Text.Encodings.Web;
HtmlEncoder.Default.Encode()
HtmlEncoder.Default.Decode()