2 hu3nr hu3nr 于 2014.09.22 15:38 提问

asp 遍历问题 声明的变量与参数的关系

Function StopHacker(values, re)
Dim l_get, l_get2, n_get, regex, IP
For Each n_get in values
For Each l_get in values
l_get2 = values(l_get)
Set regex = New regexp
regex.IgnoreCase = True
regex.Global = True
regex.Pattern = re
If regex.Test(l_get2) Then
IP = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If IP = "" Then
IP = Request.ServerVariables("REMOTE_ADDR")
End If
slog("操作IP:" & ip & "
操作时间:" & Now() & "
操作页面:" & Request.ServerVariables("URL") & "
提交方式:" & Request.ServerVariables("Request_Method") & "
提交参数:" & l_get & "
提交数据:" & l_get2 & "


")
            Response.End
        End If
        Set regex = Nothing
    Next
Next

End Function

For Each n_get in values这一句怎样理解,我觉得n_get只是一个变量,跟values有什么关系?

1个回答

showbo
showbo   Ds   Rxr 2014.11.18 14:31

for each遍历values中的值,n_get是存储values里面项的值的变量

arr=split("1,2,3",",")
for each i in arr
response.write i&"
"
next

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!