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!!!
We can write a class of the program we use, and then we'll use <! --#include file= "xxx.asp"--> to include, which gives us a new space to develop the program
Turn from: http://goaler.xicp.net/ShowLog.asp?ID=466