FormatRemoteUrl函数之asp实现格式化成当前网站完整(2)


            Exit Function
        End If

        If Left(URL, 3) = "../" Then
            Dim ArrayUrl
            Dim ArrayCurrentUrl
            Dim ArrayTemp()
            Dim strTemp
            Dim i, n
            Dim c, l
            n = 0
            ArrayCurrentUrl = Split(CurrentUrl, "/")
            ArrayUrl = Split(URL, "../")
            c = UBound(ArrayCurrentUrl)
            l = UBound(ArrayUrl) + 1

            If c > l + 2 Then
                For i = 0 To c - l
                    ReDim Preserve ArrayTemp(n)
                    ArrayTemp(n) = ArrayCurrentUrl(i)
                    n = n + 1
                Next
                strTemp = Join(ArrayTemp, "/")
            Else
                strTemp = strUrl
            End If
            URL = Replace(URL, "../", vbNullString)
            FormatRemoteUrl = strTemp & "/" & URL
            Exit Function

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/2872.html