通过一个链接,类似<../form?openform&中文> 把参数"中文"用CGI变量Query_String_Decoded装载,在代理中取出Query_String_Decoded域值,然后取到参数"中文".但"中文"为乱码.如果译码成中文呢?
可以用一个解码函数处理一下Query_String,函数如下:
Function fnDecode(inString As String) As String
inString=Replace(inString,"+"," ")
Dim L As String
Dim M As String
Dim R As String
Dim P As Integer
Dim TP As Integer
Dim fnDecode1 As String
Dim rstr As String
Dim TempStr As String
If Instr(inString,"%")>0 Then
TempStr=inString
Do While Instr(TempStr,"%")>0
P=Instr(TempStr,"%")
L=Left(TempStr,P-1)
M=Mid(TempStr,P+1,5)
If Cint("&H"+Left(M,1))<10 Then
M=Left(M,2)
If M="0A" Or M="0D" Then
If M="0D" Then
rstr=rstr+L+"<br>"
End If
Else
rstr=rstr+L+Chr(Clng("&H"+M))
End If
TP=(P+2)
Else
M=Left(M,2)+Right(M,2)
rstr=rstr+L+Chr(Clng("&H"+M))
TP=(P+5)
End If
R=Right(TempStr,Len(TempStr)-TP)
TempStr=R
Loop
fnDecode=rstr+TempStr
Else
fnDecode = inString
End If
End Function
Function fnDecode(inString As String) As String
inString=Replace(inString,"+"," ")
Dim L As String
Dim M As String
Dim R As String
Dim P As Integer
Dim TP As Integer
Dim fnDecode1 As String
Dim rstr As String
Dim TempStr As String
If Instr(inString,"%")>0 Then
TempStr=inString
Do While Instr(TempStr,"%")>0
P=Instr(TempStr,"%")
L=Left(TempStr,P-1)
M=Mid(TempStr,P+1,5)
If Cint("&H"+Left(M,1))<10 Then
M=Left(M,2)
If M="0A" Or M="0D" Then
If M="0D" Then
rstr=rstr+L+"<br>"
End If
Else
rstr=rstr+L+Chr(Clng("&H"+M))
End If
TP=(P+2)
Else
M=Left(M,2)+Right(M,2)
rstr=rstr+L+Chr(Clng("&H"+M))
TP=(P+5)
End If
R=Right(TempStr,Len(TempStr)-TP)
TempStr=R
Loop
fnDecode=rstr+TempStr
Else
fnDecode = inString
End If
End Function