最新更新 sitemap 网站制作设计本站搜索
网页设计
国外网站 韩国网站 个人主页 手提袋设计 CSS 网页特效 平面设计 网站设计 Flash CMS技巧 服装网站 php教程 photoshop 画册 服务器选用 数据库 Office
虚拟主机 域名注册 云主机 网页设计 客服QQ:8208442
当前位置:首页 > 编程开发 > asp教程

ASP数组编码ArrayList类技巧

日期:05-31    来源:中国设计秀    作者:cnwebshow.com

程序代码iaA中国设计秀
<%iaA中国设计秀
'Written By Shaoyun  Site:www.devjs.comiaA中国设计秀
Class ArrayListiaA中国设计秀
PRivate m_array()iaA中国设计秀
Private m_countiaA中国设计秀
Private Sub Class_Initialize()iaA中国设计秀
    Redim m_array(0)iaA中国设计秀
    m_count=0iaA中国设计秀
End SubiaA中国设计秀
Private Sub Class_Terminate()iaA中国设计秀
    Redim m_array(0)iaA中国设计秀
    m_count=0iaA中国设计秀
End SubiaA中国设计秀
Public Property Get Count()iaA中国设计秀
    Count=m_countiaA中国设计秀
End PropertyiaA中国设计秀
Public Property Get Item(index)iaA中国设计秀
    Item=m_array(index)iaA中国设计秀
End PropertyiaA中国设计秀
Public Function Add(arrItem)iaA中国设计秀
    Redim Preserve m_array(m_count)iaA中国设计秀
    m_array(m_count)=arrItemiaA中国设计秀
    m_count=m_count+1iaA中国设计秀
End FunctioniaA中国设计秀
End ClassiaA中国设计秀
%>iaA中国设计秀

iaA中国设计秀
使用方法如下:iaA中国设计秀

 程序代码iaA中国设计秀
<%iaA中国设计秀
dim arr : set arr=new ArrayListiaA中国设计秀
arr.add "a" : arr.add "b" : arr.add "c"iaA中国设计秀
Response.Write arr.count & "<br>"iaA中国设计秀
for i=0 to arr.count-1iaA中国设计秀
    Response.Write arr.item(i) & "<br>"iaA中国设计秀
nextiaA中国设计秀
set arr=nothingiaA中国设计秀
%>iaA中国设计秀
 iaA中国设计秀

本文引用地址:/bc/article_46275.html
网站地图 | 关于我们 | 联系我们 | 网站建设 | 广告服务 | 版权声明 | 免责声明