在 .NET Core 中如何简单高效地完成下面的字符串转换?var originRedirectUri = "https://q.cnblogs.com/account/signin?ReturnUrl=%2F";转换为var redirectUri = "https://passport.cnblogs.com/account/signin?ReturnUrl=https%3A%2F%2Fq.cnblogs.com%2F`";
1 回答
侃侃尔雅
TA贡献1801条经验 获得超15个赞
UriBuilder u = new UriBuilder("url");
var q = System.Web.HttpUtility.ParseQueryString(u.Query);
q["ReturnUrl"] = "url";
u.Query = q.ToString();
var url = u.ToString();
- 1 回答
- 0 关注
- 244 浏览
添加回答
举报
0/150
提交
取消