URL的编码和解码

如果在一段URL中需要回调地址作为参数,防止乱码,可以这么写:

localhost:15521/Customer/SingleLogin?backurl=" + HttpUtility.UrlEncode(returnUrl);

解码方法: HttpUtility.UrlDecode(returnUrl);

posted @ 2017-12-01 15:57  洛晨随风  阅读(164)  评论(0编辑  收藏  举报