公告
财富商城
积分规则
提问
发文
2019-01-03 02:40发布
再贱就再见
How can I decode an encoded URL parameter using C#?
For example, take this URL:
my.aspx?val=%2Fxyz2F
Have you tried HttpServerUtility.UrlDecode or HttpUtility.UrlDecode?
HttpServerUtility.UrlDecode
HttpUtility.UrlDecode
Try string s = System.Uri.UnescapeDataString(here);
string s = System.Uri.UnescapeDataString(here);
Try this:
string decodedUrl = HttpUtility.UrlDecode("my.aspx?val=%2Fxyz2F");
Server.UrlDecode(xxxxxxxx)
string decodedUrl = Uri.UnescapeDataString(url)
or
string decodedUrl = HttpUtility.UrlDecode(url)
Url is not fully decoded with one call. To fully decode you can call one of this methods in a loop:
private static string DecodeUrlString(string url) { string newUrl; while ((newUrl = Uri.UnescapeDataString(url)) != url) url = newUrl; return newUrl; }
最多设置5个标签!
Have you tried
HttpServerUtility.UrlDecode
orHttpUtility.UrlDecode
?Try
string s = System.Uri.UnescapeDataString(here);
Try this:
or
Url is not fully decoded with one call. To fully decode you can call one of this methods in a loop: