声明一个名为aspcn的类
Class aspcn
Private aspcn
初始化类
Private Sub Class_Initialize
aspcn="Aspcn Is Good!<br>"
End Sub
定义一个函数
Public Function DoIt()
DoIt=aspcn
End Function
定义一个方法
Public Sub QueryStr(stat)
Response.write stat
End Sub
Class aspcn
Private aspcn
初始化类
Private Sub Class_Initialize
aspcn="Aspcn Is Good!<br>"
End Sub
定义一个函数
Public Function DoIt()
DoIt=aspcn
End Function
定义一个方法
Public Sub QueryStr(stat)
Response.write stat
End Sub
End Class
Set Hi_aspcn=New aspcn 定义一个名为Hi_aspcn的aspcn对象实例
response.write Hi_aspcn.DoIt
varstr="Aspcn Is Cool!<br><font color=red>http://www.aspcn.com</font><br>WelCome!!!"
Hi_aspcn.QueryStr varstr
本文介绍了一个名为ASPCN的类的定义及其实例化过程。该类包含初始化方法、返回类属性的函数DoIt以及输出字符串的方法QueryStr。通过创建ASPCN的对象Hi_aspcn并调用其方法,演示了类的功能。
1027

被折叠的 条评论
为什么被折叠?



