?C#?,????System.Web.HttpUtility.UrlEncode?????urlencode??????System.Web?????,????System.Web????
?????HttpUtility.UrlEncode????urlencode???:
using System; using System.Web; class Program { static void Main() { string url = "https://www.example.com/?q=????"; string encodedUrl = HttpUtility.UrlEncode(url); Console.WriteLine(encodedUrl); } }
?????:https://www.example.com/?q=你好世界
HttpUtility.UrlEncode?????????????????,??????URL?????