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

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")); 

 

 

posted @ 2012-11-07 16:49  Raywang80s  阅读(917)  评论(0)    收藏  举报