




已阅读5页,还剩19页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
Asp 课程设计实验报告课程设计实验报告 在线通讯录在线通讯录 指导教师 陈陈 洁洁 学生院系 电信学院电信学院 所学专业 计算机应用技术计算机应用技术 班级学号 学生姓名 2007 年 6 月 18 日 目目 录录 1 1 绪论绪论 2 2 1 11 1 设计目的设计目的 3 3 1 21 2 开发工具的选用及介绍开发工具的选用及介绍 3 3 2 2 系统使用说明与安装系统使用说明与安装 4 4 3 3 数据库设计数据库设计 4 4 4 4 程序代码设计程序代码设计 5 5 5 5 系统运行演示系统运行演示 17 17 6 6 课程设计小结课程设计小结 24 24 参考文献参考文献 24 24 1 1 绪论绪论 1 11 1 设计目的设计目的 在目前呈几何增长的 Internet 网站中 网络已成为发布和传递信息的重要渠道 它在 人们政治 经济 生活等各个方面发挥着重要的作用 Internet 上发布信息主要是通过网 站来实现的 获取信息也是要在 Internet 海洋 中按照一定的检索方式将所需要的信息 从网站上下载下来 因此网站建设在 Internet 应用上的地位显而易见 它已成为政府 企 事业单位信息化建设中的重要组成部分 特别是动态网页的建立 从而倍受人们的重视 1 21 2 开发工具的选用及介绍开发工具的选用及介绍 1 ASP 的特点 任何开发工具皆可发展 ASP 只要使用一般的文书编辑程序 如 Windows 记事本 就 可以编辑 当然 其他网页发展工具 例如 FrontPage Dreamweaver 等也都可以 不过 一般用记事本来写 语言相容性高 ASP 与所有的 ActiveX Script 语言都相容 除了可结合 HTML VBScript Java Script Active X 服务器组件来设计外 并可经由 plug In 外 挂组件模组 的方式 使用其他厂商 Third Party 所提供的语言 隐密安全性高 如果我们在浏览器中直接查看网页的原始代码 就只能看到 html 文件 原始的 ASP 程序代码是看不到的 这是因为 ASP 程序先于网站服务 web Server 端执行后 将结果转换成标准 HTML 文件 再传送到客户端 client 的浏览器上 因此 我们所辛苦 撰写的 ASP 程序并不会轻易地被看见进而被盗用 易于操控数据库 ASP 可以轻易地通过 ODBC Open Database Connectivity 驱动程序连接各种不同的数 据库 例如 Acess Foxpro dBase Oracle 等等 另外 ASP 亦可将 文本文件 或是 Excel 文件当成数据库用 2 2 系统开发环境系统开发环境 本系统的开发环境是在 WINDOWS XP IIS5 1 数据库为 ACCESS2003 如下图所示 A 系统环境 WINXP Service Pack B IIS 5 1 环境 C 数据库环境 C Access 2003 3 3 数据库设计数据库设计 数据库设计的任务是确定所需的数据库 数据库是表的集合 本通讯录系统中只有 一个数据库 此数据库中只有一张表 建立数据库 设计表单 表单字段及格式 如 下图 设计字段内容 4 4 程序代码设计程序代码设计 该通讯录是由 2 部分构成的 左边是功能表 右边是显示具体内容 该通讯录要提供显示 添加 删除 修改 和查找成员的功能 每个人可以自由填写联系信息 并自己加个密码 只有 该成员的密码才可以维护该成员的信息 否则只能浏览 1 1 建立数据库文件建立数据库文件 address mdb address mdb 2 2 建立进入界面建立进入界面 xym htmxym htm 在线通讯录 欢迎进入在线通讯录 3 3 建立通讯录模块主页面建立通讯录模块主页面 index htmindex htm 通讯录 对不起 你必须使用支持框架页的浏览器 4 4 功能列表文件功能列表文件 menu htmmenu htm 功能列表文件 显示成员 添加成员 修改成员 删除成员 查找成员 5 5 连接数据库文件连接数据库文件 odbc connection aspodbc connection asp 6 6 显示成员文件显示成员文件 list asplist asp 查询全部成员 成员列表 姓名 电话 email 住址 年龄 简介 0 i i 1 response write response write rs name response write rs tel response write rs email response write rs home response write rs age response write rs intro response write rs movenext loop response write response write 请选择数据页 for i 1 to page total if i page no then response write i nbsp else response write i nbsp end if next end if rs close set rs nothing db close set db nothing 7 7 添加成员表单文件添加成员表单文件 add form htmadd form htm 添加成员 添加成员 带 的内容必须输入 姓名 密码 电话 email 住址 年龄 简介 8 8 添加成员文件添加成员文件 add aspadd asp 输入结果 on error resume next if trim request name or trim request password then response write 对不起 姓名和密码必须输入 response write 返回 重新填写 else dim name password tel email home age intro name request name password request password tel request tel home request home email request email age request age intro request intro dim strsql sqla sqlb sqla insert into users name password sqlb values name password if tel then sqla sqla tel sqlb sqlb tel end if if home then sqla sqla home sqlb sqlb home end if if email then sqla sqla email sqlb sqlb email end if if age then sqla sqla age sqlb sqlb age end if if intro then sqla sqla intro sqlb sqlb intro end if strsql sqla sqlb db execute strsql if db errors count 0 then response write 保存过程中发生错误 必须重新填写 response write 返回 重新填写 else response write 你的信息已安全加入 请牢记密码 response write 姓名 name response write 电话 tel response write email email response write 住址 home response write 年龄 age response write 简介 intro response write 返回 继续添加 end if end if 9 9 修改成员密码验证文件修改成员密码验证文件 change aspchange asp 修改成员 修改成员 姓名 密码 if trim request name then dim rs strsql strsql select from users where name request name and password request password set rs db execute strsql if not rs bof and not rs eof then session id rs id response redirect update form asp else response write 对不起 密码不正确 请重新输入 end if end if 10 10 修改成员表单文件修改成员表单文件 update form aspupdate form asp 修改成员 请修改您的资料 带 的内容必须输入 姓名 input type text name name size 20 value 密码 input type password name password size 20 value 电话 input type text name tel size 20 value email input type text name email size 40 value 住址 input type text name home size 40 value 年龄 input type text name age size 10 value 简介 11 11 修改成员文件修改成员文件 update aspupdate asp 更新成员 if trim request name or trim request password then response write 对不起 姓名 密码必须输入 response write 返回 重新修改 else dim name password tel email home age intro name request name password request password tel request tel home request home email request email age request age intro request intro db begintrans dim strsql strsql delete from users where id session id db execute strsql dim sqla sqlb sqla insert into users name password sqlb values name password if tel then sqla sqla tel sqlb sqlb tel end if if home then sqla sqla home sqlb sqlb home end if if email then sqla sqla email sqlb sqlb email end if if age then sqla sqla age sqlb sqlb cint age end if if intro then sqla sqla intro sqlb sqlb intro end if strsql sqla sqlb db execute strsql if db errors count 0 then db rollbacktrans response write 保存过程中发生错误 必须重新修改 response write 返回 重新修改 else mittrans response write 您的信息已经安全修改 请牢记密码 response write 姓名 name response write 电话 tel response write email email response write 住址 name response write 年龄 age response write 简介 intro response write 返回 继续修改 end if end if 12 12 删除成员文件删除成员文件 delete aspdelete asp 删除成员 删除成员 姓名 密码 if trim request name and trim request password then dim strsql strsql delete from users where name request name and password request password dim number db execute strsql number if number 0 then response write 姓名或密码输入错误 找不到记录 else response write 共有 number 条数据被删除 end if end if 13 13 查找成员文件查找成员文件 search aspsearch asp 查找成员 查找成员 姓名关键字 if trim request name then dim rs strsql set rs server createobject adodb recordset strsql select from users where name like trim request name rs open strsql db 1 if rs recordcount 姓名 电话 email 住址 年龄 简介 do while not rs eof response write response write rs name response write rs tel response write rs email response write rs home response write rs age response write rs intro response write rs movenext loop end if end if 5 5 系统运行演示系统运行演示 1 给数据库中的 users 表输入记录 2 打开浏览器 在地址栏输入 http localhost web xym htm
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 调研地理考试题及答案
- 人力资源管理系统操作手册
- 地震操场考试题及答案
- 企业团队建设与协作方案集
- 地理简单考试题及答案
- 《中西古典文学比较:大学文学概论教学教案》
- 大坝管理考试题及答案
- 心中的英雄:写关于英雄的作文4篇范文
- 销售预算编制与执行分析工具助力业务决策
- 销售业绩目标分解与考核指标模板
- 红十字救护员培训理论试题及答案
- 2025年新能源电动摆渡车景区运营绿色出行解决方案报告
- 安全素养提升培训考试题及答案解析
- 动量守恒定律模型归纳(11大题型)(解析版)-2025学年新高二物理暑假专项提升(人教版)
- 2025股权转让合同签订股权认购协议书
- 某小区改造配电室(电力)工程监理大纲
- Z20+名校联盟(浙江省名校新高考研究联盟)2026届高三第一次联考化学及答案
- DB65-T 4803-2024 冰川厚度测量技术规范
- 护理专业新进展介绍
- 2025年保监会保险机构高级管理人员任职资格考试题库附答案
- 2025年湖北省武汉市《公共基础知识》事业单位招聘考试国考真题(附答案)
评论
0/150
提交评论