C# winform及.net 中使用 Server.URLEncode

xiaoxiao2021-02-28  159

C#使用 Server.URLEncode

编码

 

System.Web.HttpUtility.UrlEncode(str,System.Text.Encoding.Unicode); System.Web.HttpUtility.UrlEncode(str,System.Text.Encoding.UTF8); System.Web.HttpUtility.UrlEncode(str,System.Text.Encoding.GetEncoding("GB2312"));

 

解码

System.Web.HttpUtility.UrlDecode(str,System.Text.Encoding.Unicode); System.Web.HttpUtility.UrlDecode(str,System.Text.Encoding.UTF8); System.Web.HttpUtility.UrlDecode(str,System.Text.Encoding.GetEncoding("GB2312"));

 

 

转载请注明原文地址: https://www.6miu.com/read-23651.html

最新回复(0)