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 (O,url)
Dim oreq
On Error Resume Next
If O is Nothing Then
'//Create XMLHTTP Object
Set oreq = CreateObject ("MSXML2. XMLHTTP ")
Else
Set oreq = O
End If
Oreq.open "Get", Url,false
Oreq.send
If Oreq.status = or Oreq.status = 0 Then
GetText = Bytes2bstr (oreq.responsebody)
Else
GetText = ""
End If
End Function