最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

FormatRemoteUrl函數(shù)之a(chǎn)sp實(shí)現(xiàn)格式化成當(dāng)前網(wǎng)站完整的URL-將相對(duì)地址轉(zhuǎn)換為絕對(duì)地址的代碼

 更新時(shí)間:2007年09月01日 22:09:04   作者:  
'================================================
'函數(shù)名:FormatRemoteUrl
'作  用:格式化成當(dāng)前網(wǎng)站完整的URL-將相對(duì)地址轉(zhuǎn)換為絕對(duì)地址
'參  數(shù): url ----Url字符串
'參  數(shù): CurrentUrl ----當(dāng)然網(wǎng)站URL
'返回值:格式化取后的Url
'================================================
    Public Function FormatRemoteUrl(ByVal URL,ByVal CurrentUrl)
        Dim strUrl
        If Len(URL) < 2 Or Len(URL) > 255 Or Len(CurrentUrl) < 2 Then
            FormatRemoteUrl = vbNullString
            Exit Function
        End If
        CurrentUrl = Trim(Replace(Replace(Replace(Replace(Replace(CurrentUrl, "'", vbNullString), """", vbNullString), vbNewLine, vbNullString), "\", "/"), "|", vbNullString))
        URL = Trim(Replace(Replace(Replace(Replace(Replace(URL, "'", vbNullString), """", vbNullString), vbNewLine, vbNullString), "\", "/"), "|", vbNullString))    
        If InStr(9, CurrentUrl, "/") = 0 Then
            strUrl = CurrentUrl
        Else
            strUrl = Left(CurrentUrl, InStr(9, CurrentUrl, "/") - 1)
        End If

        If strUrl = vbNullString Then strUrl = CurrentUrl
        Select Case Left(LCase(URL), 6)
            Case "http:/", "https:", "ftp://", "rtsp:/", "mms://"
                FormatRemoteUrl = URL
                Exit Function
        End Select

        If Left(URL, 1) = "/" Then
            FormatRemoteUrl = strUrl & URL
            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
        End If
        strUrl = Left(CurrentUrl, InStrRev(CurrentUrl, "/"))
        FormatRemoteUrl = strUrl & Replace(URL, "./", vbNullString)
        Exit Function
    End Function    

相關(guān)文章

最新評(píng)論

宁波市| 丹寨县| 临泽县| 太湖县| 武强县| 浮山县| 东辽县| 嘉定区| 晋州市| 普格县| 宁乡县| 金山区| 舞阳县| 谢通门县| 黑河市| 额济纳旗| 永泰县| 福清市| 巨野县| 金阳县| 柳林县| 油尖旺区| 湖南省| 郑州市| 崇左市| 祁阳县| 漾濞| 大庆市| 敦煌市| 昌吉市| 突泉县| 汉源县| 南江县| 读书| 普兰店市| 江陵县| 曲水县| 石河子市| 红原县| 仲巴县| 舟山市|