For the ASP (VBScript) class, I only want to show it to beginners. I hope it will help you.
Source: Internet
Author: User
First, the ASP (VBScript) class is composed of events and methods (they are members of the composition class). If you have not touched it, you can first take a look at the following description (haha, I am selling it now. Sorry for the poor description)
In the Class block, the member is declared as Private (Private member, which can only be called within the Class) or Public (Public member, which can be called inside and outside the Class) through the corresponding declaration statement ). Declared as Private will only be visible within the Class block. Declared as Public is not only visible inside the Class block, but also visible to code outside the Class block. If Private or Public statements are not used, the default value is Public. The process (Sub or Function) declared as Public within the block of the class will become the method of the class. Public variables will become attributes of the class, the same as those explicitly declared using Property Get, Property Let, and Property Set. The Default attributes and methods of classes are specified with the Default keyword in their declaration section.
Let's take a look at the blue part.
<Script language = vbscript runat = server>
Class myClass
'// ---- Declare (Declaration is defined) the internal (Private [Private]) variable of the myClass class
Private strAuthor
Private strVersion
Private strExample
'// --------------------------- Define the class event -------------------------------//
'// ---- Class_Initialize () is the class initialization event. If you use this class at the beginning, the execution of this part is triggered first, next we will initialize the author and version of the class in this member and display on the screen that the class has started.
Private Sub Class_Initialize ()
StrAuthor = "thinking source"
StrVersion = "1.0"
Response. Write "<br> myClass started <br>"
End Sub
'// ---- Class_Terminate () is the end event of the class. Once the class is exited, the event is triggered, next we will set this event to exit this class, and it will show on the screen that this class has ended.
Private Sub Class_Terminate ()
Response. Write "<br> myClass ended <br>"
End Sub
'// --------------------------- User-defined method -------------------------------//
'// ---- This method returns a version.
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>"
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service