Copy Code code as follows:
'//convert Chinese to Unicode
function urlencoding (Vstrin)
Dim i
Dim strreturn,thischr,innercode,hight8,low8
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
'//convert Unicode to normal text
function Bytes2bstr (vIn)
Dim i
Dim Strreturn,thischarcode,nextcharcode
Strreturn = ""
For i = 1 to LenB (vIn)
Thischarcode = AscB (MidB (vin,i,1))
If Thischarcode < &h80 Then
Strreturn = Strreturn & Chr (Thischarcode)
Else
Nextcharcode = AscB (MidB (vin,i+1,1))
Strreturn = Strreturn & Chr (CLng (thischarcode) * &h100 + CInt (nextcharcode))
i = i + 1
End If
Next
Bytes2bstr = Strreturn
End Function
function GetText (Oreq,url)
On Error Resume Next
'//Create XMLHTTP Object
If Oreq is Nothing Then
Set oreq = CreateObject ("MSXML2. XMLHTTP ")
End If
If not oreq are nothing Then
Oreq.open "Get", Url,false
Oreq.send
If oreq.status = MB Then
GetText = Bytes2bstr (oreq.responsebody)
Else
GetText = ""
End If
Else
GetText = ""
End If
End Function