ASP中的面向对象类
ASP中的面向对象类
发布时间:2016-12-29 来源:查字典编辑
摘要:复制代码代码如下:

复制代码 代码如下:

<%

class MyClass

Dim var '公共变量必须使用Dim

Private var2'私有变量不需要

Sub sub1

response.write var2

End Sub

Private Sub sub2

response.write var

End Sub

Sub SetVar(v)

var2=v

End Sub

end class

Set cls = new MyClass'产生对象用set

cls.SetVar("asd")

cls.var = 1

cls.sub1'封装性比较强,不会提示没有权限,直接说不支持属性或方法

%>

推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
相关阅读
网友关注
最新ASP教程学习
热门ASP教程学习
编程开发子分类