我嘗試寫一個程式(如下)去譯解(decode)一些已url encode的符號. 1至127符號能成功譯解,但由128至255符號就回復null.可否給我一點意見及解決方法?謝謝
Private Function UrlDecode(strURL As String)
Dim res As String
Dim i As Integer
Dim ss As String
i = InStr(strURL, "%")
  While i > 0
   ss = "&H" + Mid(strURL, i + 1, 2)
   res = res + Mid(strURL, 1, i - 1) + Chr(0 + ss)
   strURL = Mid(strURL, i + 3, Len(strURL) - i - 2)
   i = InStr(strURL, "%")
  Wend
  res = res + strURL
  UrlDecode = res
End Function
arrow
arrow
    全站熱搜

    vbqa 發表在 痞客邦 留言(0) 人氣()