在Asp.net中可以使用Server.HTMLEncode和Server.URLEncode 将文本或URL的特殊字符编码,
但在控制台或Winform程序中没有办法使用到这些方法,
解决办法:
System.Web 命名空间
引用System.Web.Dll

HttpUtility.HtmlEncode(str);
HttpUtility.HtmlDecode(str);

HttpUtility.UrlEncode(str);
HttpUtility.UrlDecode(str);

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-20
  • 2021-06-12
  • 2022-12-23
  • 2021-07-26
  • 2022-01-16
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-14
  • 2021-07-18
  • 2021-04-22
  • 2021-12-22
相关资源
相似解决方案