Asp删除二维数组中某行

新公司来第一个项目所遇到的问题,用于收藏夹功能,留下来做个纪念。老大自己设计的页面,相当不错,本想发出来大家共享一下,侵权的算了

<%

Action=request.QueryString("Action")

ID=request.QueryString("ID")

'删除模块

IF Action="Del" then

IF instr(request.cookies("list"),"^#^") Then

 AryReturnF = Split(request.cookies("list"),"^#^")

 For i = 0 To UBound(AryReturnF)

      AryReturnD = Split(AryReturnF(i),"^*^")

        if AryReturnD(0) =ID then

       j = i

      Do

        AryReturnF(j) = AryReturnF(j + 1)

         j = j + 1

     If j + 1 > UBound(AryReturnF) Then Exit Do

      Loop

       ReDim Preserve AryReturnF(UBound(AryReturnF) - 1)

      Exit For

    End If

 Next

For k = LBound(AryReturnF) To UBound(AryReturnF)

      if k=0 then

     m=AryReturnF(k)

     else 

m=m+"^#^"+AryReturnF(k)

    end if

next

response.cookies("list")=m

elseif request.cookies("list")<>"" then

response.cookies("list")=""

end if

response.redirect "favorite.asp"

end if

'end 删除模块

%>

网友评论:

暂无评论,马上发表?

发表评论:

邮箱: