如何计算asp经典数组中的项目数?

问题描述

我正在尝试计算在 asp 经典中的字符串/数组中有多少图像。 但我不知道我错过了什么。为什么计数器不工作?

页面加载时我选择了一些图片,它可以从 1-5 张图片不同。

theimages=image1.jpg,image2.jpg,image3.jpg,image4.jpg

Dim y,imagearray,x
imagearray=Array(theimages)
response.write(IsArray(imagearray)) //this gets me true

x=0
For i = 0 to ubound(imagearray)
        
    Response.Write imagearray(i) //gets me the right number of images
    x=x+1   
    
Next

response.write x
response.write (ubound(imagearray) + 1)

当我重新加载页面并且未解除绑定时,它不会更新 x。 那么如何计算数组中的项目?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)