关于传递数据的(高分请教)

eafin 2002-12-30 02:31:48
遇到一个问题,就是
http://www.xxxxxxx.com/class.asp?sid=007&uid=123
请问怎样得到传递的sid和uid的值,
就是只要007和123,
Thanks...
...全文
34 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
eafin 2002-12-30
  • 打赏
  • 举报
回复
ok,thanks!
saucer 2002-12-30
  • 打赏
  • 举报
回复
if you are in class.asp, apparently, you could use
Request.QueryString("sid") and Request.QueryString("uid")

if you are talking about the string itself, you could use InStr to do the job, but here is a solution that uses regular expressions:

function GetValue(sQuery, sName)
dim re, matches
GetValue = ""
set re = new RegExp
re.IgnoreCase = true
re.Pattern= "(\?|&)" + sName + "=(\w+)(&|$)"
set matches = re.Execute(sQuery)
if matches.Count > 0 then
GetValue = matches(0).SubMatches(1)
end if
set re = nothing
end function

s = "http://www.xxxxxxx.com/class.asp?sid=007&uid=123"
s1 = GetValue(s,"sid")
s2 = GetValue(s,"uid")

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧