測試調用的網頁爲aspx頁面
'包含漢字的URL轉碼函數
Private Function vbEscape(psString As String) As StringDim nTemp, sTemp, sTempChar, nTempAsc
For nTemp = 1 To Len(psString)
sTempChar = Mid(psString, nTemp, 1)
nTempAsc = AscW(sTempChar)
If (nTempAsc >= 48 And nTempAsc <= 57) Or (nTempAsc >= 65 And nTempAsc <= 90) Or (nTempAsc >= 97 And nTempAsc <= 122) Or InStr("@*_+-./", sTempChar) > 0 Then
sTemp = sTemp & sTempChar
ElseIf nTempAsc > 0 And nTempAsc < 16 Then
sTemp = sTemp & "%0" & Hex(nTempAsc)
ElseIf nTempAsc >= 16 And nTempAsc < 256 Then
sTemp = sTemp & "%" & Hex(nTempAsc)
Else
sTemp = sTemp & "%u" & Hex(nTempAsc)
End If
Next
vbEscape = sTemp
End Function