网络编程 
首页 > 网络编程 > 浏览文章

JoinChar 向地址中加入 ? 或 & 用于实现传参

(编辑:jimmy 日期: 2024/10/9 浏览:3 次 )
'**************************************************
'函数名:JoinChar
'作  用:向地址中加入 ? 或 &
'参  数:strUrl  ----网址
'返回值:加了 ? 或 & 的网址
'**************************************************
function JoinChar(strUrl)
    if strUrl="" then
        JoinChar=""
        exit function
    end if
    if InStr(strUrl,"?")<len(strUrl) then 
        if InStr(strUrl,"?")>1 then
            if InStr(strUrl,"&")<len(strUrl) then 
                JoinChar=strUrl & "&"
            Else
                JoinChar=strUrl
            end if
        Else
            JoinChar=strUrl & "?"
        end if
    Else
        JoinChar=strUrl
    end if
end function
上一篇:CreateKeyWord asp实现的由给定的字符串生成关键字的代码
下一篇:ShowPage 显示“上一页 下一页”等信息的封装代码