1 / 12

第 5 章 基本内置对象—— Response 对象和 Request 对象

第 5 章 基本内置对象—— Response 对象和 Request 对象. Response 对象 Request 对象 练习. 回目录. Response 对象. 向客户端输出字符串 将文本文件内容输出到客户端 链接网址 写入日志. 回首页. 示例5-1 使用 Response.Write 方法输出一个3行3列的表格(代码文件为 Chapter5Exam5_1.aspx). 节首页. 示例5-2 向浏览器输出文本文件(代码文件为 Chapter5Exam5_2.aspx). 节首页.

Download Presentation

第 5 章 基本内置对象—— Response 对象和 Request 对象

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 第5章 基本内置对象——Response对象和Request对象 Response对象 Request对象 练习 回目录

  2. Response对象 • 向客户端输出字符串 • 将文本文件内容输出到客户端 • 链接网址 • 写入日志 回首页

  3. 示例5-1 使用Response.Write方法输出一个3行3列的表格(代码文件为Chapter5\Exam5_1.aspx) 节首页

  4. 示例5-2 向浏览器输出文本文件(代码文件为Chapter5\Exam5_2.aspx) 节首页

  5. 示例5-3 链接网址(代码文件为Chapter5\Exam5_3.aspx) 节首页

  6. 示例5-4 记录日志(代码文件为Chapter5\Exam5_4.aspx) 1. 在Visual Studio.NET开发工具中,打开Chapter 5项目站点。 2. 创建Exam 5_4.aspx文件,并设置该页面为流布局模式。 3. 打开代码编辑窗口,在Page_load事件中输入如下代码: Response.AppendToLog("写入到日志文件中的内容。") 运行程序后,Windows 2000用户打开C:\Winnt\system32\Logfiles\W3SVC1文件夹,Windows XP用户打开C:\Windows\system32\Logfiles\W3SVC1文件夹,将会有一个exyymmdd的文件,yy为公元年末2位,mmdd表示两位的月份和两位日期。例如,2004年5月2日产生的文件名为ex040502.log,打开该文件将会看到刚加入的日志内容。 节首页

  7. Request对象 • 读取表单数据 • 判断客户端浏览器的能力 • 读取服务器端环境变量 • 使用Cookie 回首页

  8. 示例5-5 获取客户端浏览器信息(代码文件为Chapter5\Exam5_5.aspx) 节首页

  9. 示例5-6 获取服务器端环境变量(代码文件为Chapter5\Exam5_6.aspx) 节首页

  10. 示例5-7 写入Cookie(代码文件为Chapter5\Exam5_7.aspx) 下一示例

  11. 示例5-8 读取Cookie(代码文件为Chapter5\Exam5_8.aspx) 节首页

  12. 练习 • 操作题 • 填空题 回首页

More Related