'包含汉字的URL转码函数
Private Function vbEscape(psString As String) As String Dim 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 原文链接:https://www.f2er.com/vb/259599.html