Developer on Alibaba Coud: Build your first app with APIs, SDKs, and tutorials on the Alibaba Cloud. Read more ＞
Declaring a class name is to define some variables, attributes, and methods to form a class.
This is true !!!? You can use classes in VBScript !?!? I wonder if it can be used in ASP !? In this way, can I write ASP programs like objects ?! Just do it! Practice is the only criterion for testing truth. Do it yourself!
We often see descriptions of classes in other programming languages, such as PHP, VB, and C ++. This class description in VBScript is the first time I have heard of it, our daily work is website development. In this case, we have more or less experience, and we can also boast of being "professional". So I will share what I know about this new stuff. Let's take a look at the following code! (Window2000 + IIS5.0 passed the test)
''Declares a class named aspcn.
Private Sub Class_Initialize
Aspcn = "Aspcn Is Good! <Br>"
''Defines a function
Public Function DoIt ()
DoIt = aspcn
''Defines a method
Public Sub QueryStr (stat)
Response. write stat
Set Hi_aspcn = New aspcn ''defines an aspcn object instance named Hi_aspcn.
Response. write Hi_aspcn.DoIt
Varstr = "Aspcn Is Cool! <Br> <font color = red> http://www.aspcn.com </font> <br> WelCome !!! "
This is a very simple program. We declare a class named aspcn in it, and create a DoIt function and a QueryStr method. This program is very simple for everyone to understand. Its display is as follows:
Aspcn Is Good!
Aspcn Is Cool!
You can write the commonly used programs into a class, and then use it <! -- # Include file = "xxx. asp" --> to include the file. This provides us with a new space for developing programs.
From: http://goaler.xicp.net/ShowLog.asp? ID = 466
This article is an English version of an article which is originally in the Chinese language on aliyun.com and is provided for information purposes only. This website makes no representation or warranty of any kind, either expressed or implied, as to the accuracy, completeness ownership or
reliability of the article or any translations thereof. If you have any concerns or complaints relating to the article, please send an email, providing a detailed description of the concern or
complaint, to firstname.lastname@example.org. A staff member will contact you within 5 working days. Once verified, infringing content will be removed immediately.
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:
and provide relevant evidence. A staff member will contact you within 5 working days.