首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > ASP >

asp 剔除url指定参数

2012-08-17 
asp 删除url指定参数我的url是 http://127.0.0.1/index.asp?aaa1&bbb2&ccc3我要删除aaa后就是http://12

asp 删除url指定参数
我的url是 http://127.0.0.1/index.asp?aaa=1&bbb=2&ccc=3

我要删除aaa后就是

http://127.0.0.1/index.asp?bbb=2&ccc=3

删除bbb就是

http://127.0.0.1/index.asp?aaa=1&ccc=3

代码改怎么写啊 

高手们帮帮忙啊

[解决办法]
这个发错了!!

探讨
http://blog.csdn.net/knife_yu/article/details/6711614

[解决办法]
可以考虑用正则替换
[解决办法]
VBScript code
s = "http://127.0.0.1/index.asp?aaa&bbb=2&ccc=3"response.write removeQueryParam(s, "bbb")function removeQueryParam(s, p)    ar = split(s,"?")    if ubound(ar) = 0 then       removeQueryParam = s    else       QueryString = ar(1)       ar2 = split(QueryString, "&")       for i=0 to ubound(ar2)           if left(ar2(i), len(p)+1) = p & "=" or ar2(i) = p then               ar2(i) = ""           end if       next       removeQueryParam = Join(ar2, "&")       removeQueryParam = replace(removeQueryParam, "&&", "&")       if left(removeQueryParam, 1) = "&" then           removeQueryParam = right(removeQueryParam, len(removeQueryParam)-1)       end if    end ifend function 

热点排行