CopyCode The Code is 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 an XMLHTTP object
If oreq is nothing then
Set oreq = Createobject ("msxml2.xmlhttp ")
End if
If not oreq is nothing then
Oreq. Open "get", URL, false
Oreq. Send
If oreq. Status = 200 then
Gettext = bytes2bstr (oreq. responsebody)
Else
Gettext = ""
End if
Else
Gettext = ""
End if
End Function