永发信息网

asp vbsunescape是什么函数

答案:1  悬赏:40  手机版
解决时间 2021-04-02 22:38
  • 提问者网友:眉目添风霜
  • 2021-04-02 15:56
asp vbsunescape是什么函数
最佳答案
  • 五星知识达人网友:等灯
  • 2021-04-02 17:10
<%
Function vbsEscape(str)
dim i,s,c,a
s=""
For i=1 to Len(str)
c=Mid(str,i,1)
a=ASCW(c)
If (a>=48 and a<=57) or (a>=65 and a<=90) or (a>=97 and a<=122) Then
s = s & c
ElseIf InStr("@*_+-./",c)>0 Then
s = s & c
ElseIf a>0 and a<16 Then
s = s & "%0" & Hex(a)
ElseIf a>=16 and a<256 Then
s = s & "%" & Hex(a)
Else
s = s & "%u" & Hex(a)
End If
Next
vbsEscape = s
End Function
  Function vbsUnEscape(str)
dim i,s,c
s=""
For i=1 to Len(str)
c=Mid(str,i,1)
If Mid(str,i,2)="%u" and i<=Len(str)-5 Then
If IsNumeric("&H" & Mid(str,i+2,4)) Then
s = s & CHRW(CInt("&H" & Mid(str,i+2,4)))
i = i+5
Else
s = s & c
End If
ElseIf c="%" and i<=Len(str)-2 Then
If IsNumeric("&H" & Mid(str,i+1,2)) Then
s = s & CHRW(CInt("&H" & Mid(str,i+1,2)))
i = i+2
Else
s = s & c
End If
Else
s = s & c
End If
Next
vbsUnEscape = s
End Function
%>
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯