Introduced
Author: http://www.aspcn.com Flying Knife
In the day before, when I read the VBScript document to solve a grammatical problem, I stumbled across the following sentence:
Class Statement
Declares the name of a class, as a definition of the variables, properties, and methods that comprise the class.
The translation comes from ...
Class Declaration
Declaring the name of a class is defining variables, attributes, and methods to form a class
It's true!!!? Can I use class!?! in VBScript? Do not know can be used for asp!? In this way, I am not able to write an object like the ASP program?! Do what you say! Practice is the only standard to test truth, do it yourself!
We often see other programming languages have classes in the description, php,vb,c++, this in VBScript class description, I was the first time to hear, our daily work is the website development, in this more or less to make some experience, can also boast as "expert", So I'm going to share what I know about this new stuff. Let's take a look at the code below! (window2000+iis5.0 passed the test)
<%
"Declares a class named ASPCN
Class ASPCN
Private ASPCN
' Initialize class
Private Sub Class_Initialize
Aspcn= "ASPCN is good!<br>"
End Sub
"Define a function
Public Function DoIt ()
Doit=aspcn
End Function
"Define a method
Public Sub QUERYSTR (STAT)
Response.Write Stat
End Sub
End Class
Set hi_aspcn=new ASPCN ' defines an instance of a Aspcn object named HI_ASPCN
Response.Write HI_ASPCN. DoIt
Varstr= "ASPCN is Cool!<br><font color=red>http://www.aspcn.com</font><br>welcome!!!"
HI_ASPCN. Querystr Varstr
%>
This is a very simple program, in which we declare a class named ASPCN, set up a doit function, a querystr method, which is very simple to believe that you can read, it shows as follows:
ASPCN is good!
ASPCN is cool!
Http://www.aspcn.com
WelCome!!!
Later, we will be able to use the program we used to write a class, and then with <! --#include file= "xxx.asp"--> to include in the line, which gives us the development of the program and provide a new space, really cool ah! and C + +, a bit back to the feeling of nature.
This article from the Http://www.aspcn.com ASP China Network If you want to reprint please be sure to indicate the source, thank you