Class declaration
Declare a class name, that is, define some variables, attributes, methods to form a class.
This is real! ! ! ? Can use classes in VBScript! ? ! ? I don't know if I can be used for ASP!?, I am not able to write an ASP program like Object? ! Talk to dry! Practice is the only standard for testing truth, self-service!
We often see that there are classes in other program languages, PHP, VB, C , this description of this class in VBScript, I heard that our daily work is the website development, in this More than doing more experience, like the model is also self-interested in "within", so I will share this new stuff I know. Let's take a look at the code below! (Window2000 IIS5.0 through test)
<% 'Declare a class class aspcnprivate aspcn' initialization class private sub class_initializeaspcn = "ASPCN is good!
" end subs "Defines a function public function DOIT () DOIT = Aspcnend Function '' A method pub QueryStr (Stat) Response.write STATEND SUB
END CLASS
SET HI_ASPCN = New aspcn '' Defines an ASPCN object instance called Hi_ASPCN RESPONSE.WRITE HI_ASPCN.DOITVARSTR = "ASPCN IS COOL!
http://www.aspcn.com font>
Welcome !!! "Hi_ASpcn.QueryStr Varstr
%>
This is a very simple program, we declare a class named aspcn, build a DOIT function, a queryStr method, this program is very simple to believe that it can be understood, its display is as follows:
Aspcn is food! Aspcn is cool! Http://www.aspcn.comwelcome !!!
You can write our usage to a class, you can use it! - # include file = "xxx.asp" -> to include it, this provides us with new space