Using a class in VBScript involves some object-oriented thinking. Use a variety of languages can write COM components, used in the ASP, these languages include C, VB, Delphi or Java, you can see the Windows operating system can be compatible with many things, these may be applied to the ASP. But these things are far from practical applications, mainly based on VBScript, ASP, from Microsoft scripting language.
The concept of the module brings a lot of benefits, see the top article, he was written by a friend of mine: http://www.aspxuexi.com/class/2006-4-26/asp_class.htm
Many domestic and foreign programmers to create a lot of such modules, modified can be used for us, these are worth the collection of scripts are placed in this site, collected into a year, the ASP learning online This part of the information is relatively complete.
Refer to: http://www.aspxuexi.com/class/
Emphasizing oop (object-oriented) ideas in web programming can complicate simple problems, but without mastering this approach, we will lose the chance to find the simplest way.
ASP is not a programming language, so there is no real concept of class, usually called ASP, should refer to a Dynamic Web site solution. The ASP class we refer to is the class used by the programming language VBScript when it is applied in ASP.
For a tutorial on VBScript scripting, see: Http://www.aspxuexi.com/vbscript/index.htm We can also use JScript to write ASP, but VBScript is the best.
ASP class is relatively simple, it does not have the real meaning of the class inheritance, overload, and so on, however, it is still very useful, it reduces the complexity of our programming, so that our program modules more reasonable.
The ASP's classes support the following:
Public member variables, private member variables, properties
Public member functions, private member functions
constructors, destructors
Please check this section for http://www.aspxuexi.com/class/2006-4-26/asp_class.htm
One of the simplest ASP classes
Class Aspxuexi
Sub Printhello ()
Response. Write "Hello world!"
End Sub
End Class
As you can see, the basic structure of the ASP class is:
Class name
Class Code
End Class
Use one of the simplest ASP classes
Dim obj
Set obj = new Aspxuexi ' creates an object using set new, and cannot use server because it is not a server component. CreateObject Create
Call obj. The Printhello ' object name is added, followed by a member variable, property, or function, which indicates that the member variable, property, or function that called the object will display the Hello world! This is the same thing as using those built-in objects, such as application objects.
Set obj = Nothing ' free objects
Constructors cannot be overloaded in an ASP class, so we cannot create classes using statements similar to set obj = new Aspxuexi ("Subobj").