-1
如何改變這種用urlencode功能ASP到ASP.NET如何改變URL編碼功能的ASP到ASP.NET
Function URLEncode
Dim StrTemp, StrChar
Dim IntPos, IntKey
StrTemp = ""
StrChar = ""
For IntPos = 1 To Len(encodeString)
IntKey = Asc(Mid(encodeString, IntPos, 1))
If IntKey = 32 Then
StrTemp = StrTemp & "+"
ElseIf ((IntKey < 123) And (IntKey > 96)) Then
StrTemp = StrTemp & Chr(IntKey)
ElseIf ((IntKey < 91) And (IntKey > 64)) Then
StrTemp = StrTemp & Chr(IntKey)
ElseIf ((IntKey < 58) And (IntKey > 47)) Then
StrTemp = StrTemp & Chr(IntKey)
Else
StrChar = Trim(Hex(IntKey))
If IntKey < 16 Then
StrTemp = StrTemp & "%0" & StrChar
Else
StrTemp = StrTemp & "%" & StrChar
End If
End If
Next
Return StrTemp
End Function
我不知道該如何ASP改爲asp.net。
[編碼功能,支持Unicode和工作在asp和asp.net]可能的副本(http://stackoverflow.com/questions/6491550/encoding-function-that-supports-unicode-and-works-in -both-asp-and-asp-net) –