'====================================================================
'Nama fungsi: formatRemoteUrl
Fungsi: Format URL lengkap dari situs web saat ini - Konversi alamat relatif ke alamat absolut
'Argumen: URL ---- URL String
'Parameter: CurrentUrl --- Tentu saja URL situs web
'Nilai pengembalian: URL yang diformat
'====================================================================
PublicFunctionFormatRemoteUrl (ByValurl, ByValcurrentUrl)
Dimstrurl
Iflen (url) <2orlen (url)> 255orlen (currentUrl) <2then
FormatRemoteUrl = vbnullString
Fungsi keluar
Endif
CurrentUrl = trim (ganti (ganti (ganti (ganti (ganti (ganti (ganti (currentUrl, "'", vbnullString), "" "", vbnullstring), vbnewline, vbnullstring), "/", "/", "|", vbnullstring))))
Url = trim (ganti (ganti (ganti (ganti (ganti (ganti (ganti (ganti (url, "'", vbnullstring), "" "", vbnullstring), vbnewline, vbnullstring), "/", "/", "|", vbnullstring))))
Ifinstr (9, currentUrl, "/") = 0then
Strurl = CurrentUrl
Kalau tidak
strurl = kiri (currentUrl, instr (9, currentUrl, "/")-1)
Endif
Ifstrurl = vbnullStringthinstrurl = currentUrl
SelectCaseleft (LCase (URL), 6)
Kasus "http:/", "https:", "ftp: //", "rtsp:/", "mms: //"
FormatRemoteUrl = url
Fungsi keluar
Endselect
Ifleft (url, 1) = "/" lalu
FormatRemoteUrl = Strurl & url
Fungsi keluar