首页 > 解决方案 > 您如何使用具有 abc%5Bxyz%5D 的查询字符串数据?

问题描述

使用查询字符串http://www.contoso.com/student?id=12345更容易使用数据

但是你如何在控制器上使用 abc%5Bname%5D 的数据呢? http://www.contoso.com/student?abc%5Bname%5D=john

标签: c#

解决方案


你要HttpUtility.UrlDecode()

var url = "http://www.example.com/student?abc%5Bname%5D=john";
url = HttpUtlity.UrlDecode(url);

推荐阅读