First of all, the ASP's class is composed of events and methods (they are composed of members of the class), if we have not been contacted, you can first look at the following instructions (haha, I am now learning to sell, say well please forgive me)
in a class block, a member is declared private (private, only within a class) or public (publicly owned, which can be called outside of a class) by the appropriate declaration statement. The declared Private will be visible only within the Class block. Being declared public is not only visible inside the class block, but also for code outside of the class block. Default is public that is not explicitly declared using Private or public. A procedure (Sub or Function) declared as public within a block of a class becomes a method of the class. The public variable becomes the property of the class, the same as the properties that are explicitly declared by using the property's get, the attribute let, and the Set. The default properties and methods of a class are specified in their declaration section by the default keyword.
Please read the blue part inside, let's take a look at an example
<script Language=vbscript runat=server>
Class MyClass
'//----declaration (Declaration is defined) the internal (private [private]) variable of the class MyClass class
Private Strauthor
Private strversion
Private Strexample
'//---------------------------Define event-------------------------------for class//
'//----Class_Initialize () is the initialization event for the class, which first triggers the execution of that part, and then we initialize the author and version of the class in that member and the screen shows that the class has begun.
Private Sub Class_Initialize ()
Strauthor = si Source
Strversion = 1.0
Response.Write <br>myclass started the <br>
End Sub
'//----class_terminate () is the end event of the class, and as soon as the class is exited, the event is triggered, and we will set the event to exit the class when the class is displayed on the screen.
Private Sub Class_Terminate ()
Response.Write <br>myclass is over. <br>
End Sub
Public Sub information ()
Response.Write <br>coding by <a href= ' mailto:coder@sinobe.com ' >Maxid_Zen</a> @ <a href= ' http:// Www.design60s.com ' >www.design60s.com</a>.<br>
End Sub
'//---------------------------define the output properties of the class-------------------------------//
'//----The property of a class that allows the user to initialize the STREXAPMLE variable
Public Property Let Setexapmle (ByVal Strvar)
Strexapmle = Strvar
End Property
'//---------------------------define the output properties of the class-------------------------------//
'//----Define the properties of the class, which is to return a version number
Public Property Get Version
Version = Strversion
End Property
'//----Define the property of the class, which is the author number that returns the class
Public Property Get Author
Author = Strauthor
End Property
'//----Define the properties of the class, which is to return a version number
Public Property Get Exapmle
Exapmle = Strexapmle
End Property
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.