'=====================================================================
'Nome da função: formatRemoteurl
'Função: formate o URL completo do site atual - converta o endereço relativo em endereço absoluto
'Argumentos: URL ---- String
Parâmetros: Currenturl --- é claro que o URL do site
'Valor de retorno: URL formatado
'=====================================================================
PublicFunctionFormatRemoteurl (ByValurl, ByvalCurrenturl)
DIMSTRURL
Iflen (url) <2orlen (url)> 255orlen (currenturl) <2then
FormatRemoteurl = vbnullString
Saída de saída
Endif
CurrentUrl = Trim (substitua (substitua (substitua (substitua (substitua (substitua (currenturl, "'", vbnullstring), "" "" ", vbnullstring), vbnewline, vbnullstring),"/","/"," | ", vbnullstring)))),"/","/"," | ", vbnullstring)))
Url = acabamento (substituir (substituir (substituir (substituir (substituir (substituir (url, "'", vbnullstring), "" "", vbnullstring), vbnewline, vbnullstring), "/", "/", "|", vbnullstring))), "/", "/", "|", vbnullstring)))), "
Ifinstr (9, currenturl, "/") = 0hen
strurl = currenturl
Outro
strurl = esquerda (currenturl, instrum (9, currenturl, "/")-1)
Endif
Ifstrurl = vbnullStringthinstrurl = currenturl
SelectCaseleft (LCase (URL), 6)
Case "http:/", "https:", "ftp: //", "rtsp:/", "mms: //"
FormatRemoteurl = url
Saída de saída
EndSelect
Ifleft (url, 1) = "/" então
FormatRemoteurl = strurl & url
Saída de saída