?C#?,?????URL?,?????URL???????URL??????????????C#?,????HttpUtility.UrlEncode????URL????,????????????
??,??????????????URL??????????,????UrlEncode???????????,???URL????????????:
string userInput = "Hello World!"; string encodedInput = HttpUtility.UrlEncode(userInput); string url = "https://www.example.com/page?param=" + encodedInput;
??????,???????"Hello World!"?????"Hello+World!",????URL??????????????????URL?????????????
??,??????URL????,????HttpUtility.UrlDecode?????????:
string url = "https://www.example.com/page?param=Hello+World!"; string decodedParam = HttpUtility.UrlDecode(url); Console.WriteLine(decodedParam); // ??: Hello World!
?????????URL????????????????????C#???URL????????