-1
我想編寫用於asp.net和asp的兩個函數。我想寫兩個版本。該功能用於URL編碼和解碼。現在,我遇到了一個新問題。這是如何工作server.urlencode。那麼,如何實現這個url編碼功能。我有asp的網址解碼功能。我嘗試爲asp獲取url編碼功能。所以,我可以在asp.net中編寫url編碼和解碼。請幫幫我。如何使用asp.net和asp之間的url編碼功能
這是網址解碼功能。
Function URLDecode(sConvert)
Dim aSplit
Dim sOutput
Dim I
If IsNull(sConvert) Then
URLDecode = ""
Exit Function
End If
' convert all pluses to spaces
sOutput = REPLACE(sConvert, "+", " ")
' next convert %hexdigits to the character
aSplit = Split(sOutput, "%")
If IsArray(aSplit) Then
sOutput = aSplit(0)
For I = 0 to UBound(aSplit) - 1
sOutput = sOutput & _
Chr("&H" & Left(aSplit(i + 1), 2)) &_
Right(aSplit(i + 1), Len(aSplit(i + 1)) - 2)
Next
End If
URLDecode = sOutput
End Function
我得到了this。
您是否在ASP.NET頁面中使用C#或VB.NET? –
[編碼功能,支持Unicode和工作在asp和asp.net]可能的重複(http://stackoverflow.com/questions/6491550/encoding-function-that-supports-unicode-and-works-in-both -Asp和-ASP網) –