[转]ASP实现关键词获取(各搜索引擎,GB2312及UTF-8)(2)
end if
Next
End If
if err then
err.clear
GetSearchKeyword = RefererUrl
else
GetSearchKeyword = ""
end if
End Function
Function URLEncoding(vstrIn)
dim strReturn,i,thischr
strReturn = ""
For i = 1 To Len(vstrIn)
ThisChr = Mid(vStrIn,i,1)
If Abs(Asc(ThisChr)) < &HFF Then
strReturn = strReturn & ThisChr
Else
innerCode = Asc(ThisChr)
If innerCode < 0 Then
innerCode = innerCode + &H10000
End If
Hight8 = (innerCode And &HFF00)\ &HFF
Low8 = innerCode And &HFF
strReturn = strReturn & "%" & Hex(Hight8) & "%" & Hex(Low8)
End If
Next
URLEncoding = strReturn
End Function
function getkey(key)
dim oreq
set oreq = CreateObject("MSXML2.XMLHTTP")
oReq.open "POST","http://"&WebUrl&"/system/ShowGB2312XML.asp?a="&key,false
oReq.send
getkey=UTF2GB(oReq.responseText)
end function
function chinese2unicode(Str)
dim i
dim Str_one
dim Str_unicode
for i=1 to len(Str)
Str_one=Mid(Str,i,1)
Str_unicode=Str_unicode&chr(38)
Str_unicode=Str_unicode&chr(35)
Str_unicode=Str_unicode&chr(120)
Str_unicode=Str_unicode& Hex(ascw(Str_one))
Str_unicode=Str_unicode&chr(59)
next
内容版权声明:除非注明,否则皆为本站原创文章。