ASP six major object introductions

xiaoxiao2021-03-05  21

The Application object Application object is an application-level object to share information between all users and can maintain data during the Web application running. Application's Properties: The method is as follows: Application object does not have built-in properties, but we can create its properties yourself. <% Application ("Attribute Name) = Value%> In fact, most Application variables are stored in the Contents collection, when you create a new Application variable, actually adding an item in the Contents collection. The following two scripts are equivalent: <% Application ("Greeting") = "Hello!"%> Or <% Application.contents ("Greeting") = "Hello!" Because the Application Variable is in the collection, if you want To display all, however, we have used multiple times, such as for Each loops. <% For each itemin application.contents response.write ("
") Next%> Application method: Application method only two methods: one is LOCK, the other is Unlock. Where the LOCK method is used to ensure that only one user can operate on the Application. UNLOCK is used to cancel the limit of the LOCK method. Such as: <% Application.lock Application ("Visitor_Num") = Application ("Visitor_num") 1 Application.unlock%> Application's event: 1. Application_onstart () triggered when the event application starts. 2, Application_ONEND () This event application triggered. These two events must be defined in the global.asp file, generally defining the function of the connection data in both events and placed in Global.asp. For example: Sub Application_onstart Application ("TT18_Connectionstring") = "driver = {SQL Server}; server = jeff; UID = SA; PWD =; Database = TEST" End Sub A array can be defined as Application object, but this array can only Save as an object without using Application (0) to remove its value. You can define a temporary array implementation. Such as: <% DIM array () array = application ("array" for i = 0 to ubound (array) response.write array (i) Next I%> To modify this Application object, you can also define a temporary array, The Application object assigns an array and then modifies the elements of this array, and finally assign an array to the Application object.

Such as: <% DIM array () array = application ("array") array (0) = "jeff" array (1) = "zhu" Application.lock Application ("array) = array application.unlock%> ObjectContext object This object is used to control the transaction processing of Active Server Pages. The Office is managed by Microsoft Transaction Server (MTS). Event ObjectContext.ontransactionabort is excited by the abandoned transaction event, which occurs after the script is completed. ObjectContext.ontransactionCommit is excited by successful transaction event, which occurs after the script is completed. Method ObjectContext.Setabort explicitly waives one transaction. ObjectContext.setComplete overwrites any call to the ObjectContext.Setabort method in front. The Request object Request object is used to accept all information from the request from the browser to your server. Collection Request.ClientCertificate (Key [Subfield]) Collection of all customer certificates. For Key, this collection has the following keywords: The subject of the Subject certificate. Contains all information about certificate receipts. Can be used with all subdomain suffixes. Issuer certificate issuer. Contains all information about certification verification. In addition to CN, it can be used with all subdomain suffixations. VadidFrom certificate issued date. Use the VBScript format. Validuntil This certificate is not valid. SerialNumber contains the serial number of the certificate. Certificate contains binary streams of the entire certificate, using the ASN.1 format. For Subfield, Subject, and Issuer keywords can have subordinate suffixes: (such as: Subjectou or Issuerl) C originated. O Company or organization name. OU organizational unit. CN user's routine name. L Local. S state (or provincial). Tone or company title. GN given name. I is initially. When file cervbs.inc (VBScript) or CERJAVAS.INC (JScript) is included in your Active Server Page by using the #include oriented, the following two flags can be used: CecertPresent indicates whether the customer certificate exists, its value is true. Or false. CEUNRECONGNIZEDISSURE indicates whether the issuer of the last certificate in the chain is unknown, its value is True or FALSE. Request.cookies (cookie [(key) .attribute]) Cookie collection. Allow the browser's cookie. Cookie indicates that returns that cookie. KEY is used to return a cookie value with a keyword from the Cookie dictionary. For Attribute, you can use attribute Haskeys to determine if a cookie has a child keyword. The value of Haskeys is TRUE or FALSE. Request.form [(index) .count] Fill in the collection of all data in the HTML form. Parameter is the name of a certain element in the HTML form. When a parameter has more than one value (for example, when using a multiple attribute in