ASP类编写详细说明

2019-01-12 14:47:29王冬梅

 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

</script>
<%

'//-------这里是使用该类的例子

Dim oneNewClass

Set oneNewClass = myClass

Response.Write 作者: & oneNewClass.Author & <br>
Response.Write 版本: & oneNewClass.Version & <br>

oneNewClass.setExapmle = 这是一个简单类的例子

Response.Write 用户自定义: & oneNewClass.Exapmle & <br>

oneNewClass.Information

Set oneNewClass = Nothing

%>