如何编写一个ASP类(2)
End Sub
'//---------------------------定义类的输出属性-------------------------------//
'//----定类的属性,该属性是让用户初始化strExapmle变量
Public Property Let setExapmle(ByVal strVar)
strExapmle = strVar
End Property
'//---------------------------定义类的输出属性-------------------------------//
'//----定义类的属性,该属性是返回一个版本号
Public Property Get Version
Version = strVersion
End Property
'//----定义类的属性,该属性是返回该类的作者号
Public Property Get Author
Author = strAuthor
End Property
'//----定义类的属性,该属性是返回一个版本号
Public Property Get Exapmle
Exapmle = strExapmle
End Property
End Class
%><%
'//-------这里是使用该类的例子
Dim oneNewClass
Set oneNewClass = New myClass
Response.Write "作者: "& oneNewClass.Author &" <br>"
Response.Write "版本: "& oneNewClass.Version &" <br>"
oneNewClass.setExapmle = "这是一个简单类的例子"
Response.Write "用户自定义:" & oneNewClass.Exapmle &" <br>"
oneNewClass.Information
Set oneNewClass = Nothing
%>
内容版权声明:除非注明,否则皆为本站原创文章。