当前位置: 首页 > 网络学院 > 服务端脚本教程 > ASP > ASP Response

ASP
ASP Drive
ASP File
ASP Folder
ASP Dictionary
ASP ADO
ASP AdRotator
ASP BrowserCap
ASP Content Linking
ASP Content Rotator
ASP Quick Ref
ASP 摘要
ASP 实例

ASP Response


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-01   浏览: 791 ::
收藏到网摘: n/a

The ASP Response object is used to send output to the user from the server.
ASP Response对象是用来把服务器上的结果发送给用户的。


Examples
实例

Write text with ASP
用ASP写一段文本
This example demonstrates how to write text with ASP.
这个例子将告诉我们如何用ASP写一段文本。

Format text with HTML tags in ASP
使用ASP给输出的文本加HTML标签
This example demonstrates how to combine text and HTML tags with ASP.
这个例子告诉我们如何给输出的文本加上HTML标签

Redirect the user to a different URL
如何指向另外一个网址
This example demonstrates how to redirect the user to a different URL.
这个例子将告诉我们如何指向另外一个网址

Show a random link
如何进行随机链接
This example demonstrates a link, each time you load the page, it will display one of two links: W3Schools.com! OR Refsnesdata.no! There is a 50% chance for each of them.
这段代码内写入了两个链接地址,当你通过浏览器浏览这段代码时,看到的将是这两个网址中的一个,这两个网址在浏览器上显示的几率分别是50%。

Controlling the buffer
如何控制缓冲器
This example demonstrates how you can control the buffer.
这个例子讲告诉我们如何控制一个缓冲期

Clear the buffer
如何清除缓冲器
This example demonstrates how you can clear the buffer.
这个例子将告诉我们如何清除缓冲器

End a script in the middle of processing and return the result
如何结束程序执行中的脚本并直接返回结果
This example demonstrates how to end a script in the middle of processing.
这个例子将告诉我们如何结束程序执行中的脚本并直接返回结果

Set how many minutes a page will be cached in a browser before it expires
设置页面缓存的过期时间
This example demonstrates how to specify how many minutes a page will be cached in a browser before it expires.
这个例子将告诉我们如何给页面缓存设置一个过期的时间

Set a date/time when a page cached in a browser will expire
设置页面缓存过期的具体日期
This example demonstrates how to specify a date/time a page cached in a browser will expire.
这个例子讲告诉我们如何给页面缓存设置一个过期的具体日期

Check if the user is still connected to the server
检测用户是否依然和服务器保持连接
This example demonstrates how to check if a user is disconnected from the server.
这个例子将告诉我们如何检测用户是否依然和服务器保持连接

Set the type of content
设置内容属性
This example demonstrates how to specify the type of content.
这个例子讲告诉我们如何设置一个页面的内容属性

Set the name of the character set
设定输出字符的名称
This example demonstrates how to specify the name of the character set.
这个例子将告诉我们如何设置输出字符的名称


Response Object
Response对象

The ASP Response object is used to send output to the user from the server. Its collections, properties, and methods are described below:
ASP Response对象是用来把服务器上的结果发送给用户的。下面,我们将为各位归纳出其所有的集合、属性以及方法:

Collections
集合

Collection
集合
Description
描述
Cookies Sets a cookie value. If the cookie does not exist, it will be created, and take the value that is specified
设定一个Cookie的值。如果这个Cookie不存在,那么它将被自动建立起来, 并赋给它指定的值。

Properties属性

Property
属性
Description
描述
Buffer Specifies whether to buffer the page output or not
设定是否要对页面输出的结果进行缓冲
CacheControl Sets whether a proxy server can cache the output generated by ASP or not
设定一个代理服务器是否要对ASP页面产生的结果进行缓存
Charset Appends the name of a character-set to the content-type header in the Response object
给Content-Type标题设置一个charater-set(字符编码的设置)的名字
ContentType Sets the HTTP content type for the Response object
给Response对象设置一个HTTP内容的类型
Expires Sets how long (in minutes) a page will be cached on a browser before it expires
给页面设置一个缓存过期的时间(单位:分钟)
ExpiresAbsolute Sets a date and time when a page cached on a browser will expire
给页面设置一个缓存过期的具体日期
IsClientConnected Indicates if the client has disconnected from the server
检查用户是否已和服务器断开连接
Pics Appends a value to the PICS label response header
给PICS标签追加一个值
Status Specifies the value of the status line returned by the server
设定服务器返回的状态信息

Methods
方法

Method
方法
Description
描述
AddHeader Adds a new HTTP header and a value to the HTTP response
给HTTP加上一个值和新的头部信息
AppendToLog Adds a string to the end of the server log entry
在服务器日志的结尾处加一条字符串
BinaryWrite Writes data directly to the output without any character conversion
在不进行任何字符转化的情况下把数据直接写入结果
Clear Clears any buffered HTML output
清除任何HTML页面的缓冲
End Stops processing a script, and returns the current result
停止运行脚本,直接返回当前值
Flush Sends buffered HTML output immediately
直接发送缓冲的HTML页面的结果
Redirect Redirects the user to a different URL
转向连接另一个网址
Write Writes a specified string to the output
输出指定的字符串

评论 (0) All

登陆 | 还没注册?