日期:2014-05-17  浏览次数:20438 次

asp.net Url参数解码
JScript code

function filterWords(keywords) {
    return keywords.replace(new RegExp("-", "g"), "%2D").replace(/@/g, "%40").replace(new RegExp("\\*", "g"), "%2A").replace(new RegExp("\\+", "g"), "%2B").replace(new RegExp("\\/", "g"), "%2F").replace(new RegExp("\\.", "g"), "%2E");
}
var where="中国";
where=escape(where).replace(new RegExp("%", "g"), "$");
where =filterWords(where);



谁帮我在asp.net反替换回来一下

------解决方案--------------------
C# code

Microsoft.JScript.GlobalObject.unescape(
    字符串
        .Replace("%2D", "-")
        .Replace("%40", "@")
        .Replace("%2A", "*")
        .Replace("%2B", "+")
        .Replace("%2F", "/")
        .Replace("%2E", ".")
        .Replace("$", "%")
    );