恳请高手指教,只谈心得,多少无妨。谢谢。
---------------------------------------------------------------
Application对象是个应用程序级的对象,用来在所有用户间共享信息,并可以在Web应用程序运行期间持久地保持数据。
Application的属性:
方法如下:
Application对象没有内置的属性,但是我们可以自行创建其属性。
1 Application("属性名")=值
其实大部分Application变量都 存放在Contents集合中,当你创建一个新的Application变量时,其实就是在Contents集合中添加了一项。下面两个脚本是等效的:
1 Application("greeting")="hello!"
2``` 或 ```
3 Application.contents("greeting")="hello!"由于Application变量存在集合里,所以如果想要全部显示,其方法我们已经多次使用,例如For Each循环。
4<%
5For Each item IN Application.Contents
6Response.write("
<br/>
1"&item&Application.Contents(item))
2next
Application的方法:
Application的方法只有两个方法:一个是Lock,另一个是Unlock。其中Lock方法用于保证同一时刻只能一个用户对Application操作。Unlock则用于取消Lock方法的限制。如:
1
2Application.Lock
3Application("visitor_num")=Application("visitor_num")+1
4Application.Unlock
Application的事件:
1、Application_OnStart()
当事件应用程序启动时触发。
2、Application_OnEnd()
此事件应用程序结束时触发。
这两个事件过程都是必须定义在Global.asp文件中,一般把连接数据的函数定义在这两个事件,然后放在Global.asp中。例如:
Sub Application_OnStart
Application("tt18_ConnectionString") = "driver={SQL
Server};server=jeff;uid=sa;pwd=;database=test"
End Sub
一个数组能够被定义成Application对象,不过这个数组只能作为一个对象保存,而不能用Application(0)取出其值。可以定义一个临时数组实现这种功能。如:
1
2dim Array()
3Array=Application("array")
4for i = 0 to ubound(array)
5Response.write Array(i)
6next i
同样要修改这个Application对象也可以定义一个临时数组,把Application对象赋给数组,然后修改这个数组的元素,最后把数组赋回Application对象。如:
1
2dim Array()
3Array=Application("array")
4Array(0)="jeff"
5Array(1)="zhu"
6Application.lock
7Application("array")=Array
8Application.unlock
ObjectContext对象 (双击鼠标滚屏)
时间:2002-7-4 11:24:14 作者:网人 来源:网人俱乐部
该对象用于控制Active Server Pages的事务处理。事务处理由Microsoft Transaction Server (MTS)管理。
事件
ObjectContext.OnTransactionAbort
由放弃的事务处理事件激发,在脚本完成处理后发生。
ObjectContext.OnTransactionCommit
由成功的事务处理事件激发,在脚本完成处理后发生。
方法
ObjectContext.SetAbort
显式的放弃一次事务处理。
ObjectContext.SetComplete
覆盖前面任何调用ObjectContext.SetAbort方法的调用。
---------------------------------------------------------------
Application对象 使给定应用程序的所有用户共享信息
Request对象 访问POST方法或GET方法传递的参数
Response对象 控制发送给用户的信息
Server对象 对服务器上的方法和属性进行访问
Session对象 存储特定的用户会话所需的信息
ObjectContext对象 提交或撤消由ASP脚本初始化的事务
ASPError对象 提供最近发生的错误的详细信息
---------------------------------------------------------------
Active Server Pages Guide
Welcome to the Active Server Pages Guide. This section provides detailed information about creating ASP pages and developing Web applications. It also describes the special event methods and interfaces available for creating components for access by ASP or ISAPI extensions. In this section you will find information on how to store your custom IIS configuration data and how you can use built-in objects to manipulate that data. Finally, the guide provides a library of script and program samples demonstrating a variety of ways to interact with IIS.
This section contains:
Active Server Pages: Provides an introduction to creating Active Server Pages and demonstrates most of the key concepts for understanding the IIS programming platform.
Developing Web Applications: Outlines concepts of how IIS fits into the Microsoft architecture for distributed applications, as well as providing specific details for designing and implementing applications for deployment through HTTP.
Administering IIS Programmatically: Provides overviews and reference material to help you manage the IIS configuration programmatically.
Visual Basic Object Model: Describes the properties and methods of the ASP Built-in Objects.
Installable Components for ASP: Outlines a variety of components you can install to work with ASP.
Script Reference: Contains miscellaneous reference material, including the @ directives and Global.asa references.
ASP Samples: Provides demonstration scripts, illustrating most of the concepts presented in the guide.
---------------------------------------------------------------
对ASP的学习比较简单,一个网站坐下来就差不多了,对编程的基础水平要求不是很高,
开发过程中要多使用MSDN和JAVASCRIPT的语法帮助