问题描述
- 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有什么关系?
解决方案
for each遍历values中的值,n_get是存储values里面项的值的变量
arr=split("1,2,3",",")
for each i in arr
response.write i&"
"
next
时间: 2024-11-10 00:58:34