校友录管理系统
学生姓名 专业班级 指导教师 完成日期
任务书
学生姓名 课题名称 指导教师 指导教师 指导教师 班级 学号 课题组人数 职称 职称 职称 校友录管理系统 实 训 任 务 及 要 求 一、 实训目标 通过实训达到熟练灵活地使用C#语言,掌握ASP.NET应用的基本技能及SQL Server数据库的相关操作。 二、 实训内容 校友录系统开发的目的是实现校友之间的信息交流。具有创建学校、创建班级的功能,还包括加入班级成员,查看班级成员的信息和校友信息留言功能。本系统要求具有以下功能: 1. 班级管理员对功能的需求 (1)班级成员信息管理:可浏览班级所有成员的信息,并审核要求成为班级成员的用户信息。 (2)留言信息管理:可浏览、添加,并维护所有班级成员留言的信息。 2.班级用户对功能的需求 (1)申请加入班级管理:用户找到所在班级后可申请加入此班级。 (2)个人信息管理:可注册、修改个人信息。 3.系统管理 (1)用户登录:用于登录系统,并划分用户的权限。 (2)用户信息管理:查看注册、修改用户信息。 (3)学校信息管理:查找一个学校或创建一个新学校。 (4)班级信息管理:查找一个班级或创建一个新班级。 (5)加入班级信息管理:申请加入一个班级。 (6)班级成员信息管理:审核班级成员的信息。 (7)信息留言管理:普通班级成员可添加留言信息。 三、 开发环境 开发平台:Microsoft Visual Studio 2005,语言:C#,数据库:SQL Server 2000 一、对用户登录界面()进行设计及美化。 学生需二、对班级通讯录界面()进行设计及美化。 完三、对班级注册界面的查询学校所在区域界面()进行设计及美化。 成的具四、对班级注册界面的寻找学校界面()进行设计及美化。 体任务 五、协助小组成员,进行各界面的美化、设计工作。 《Visual C# + SQL Server 数据库开发与实例》 李律松,马传宝,李婷等编著;清华 学出版社;2006年8月第1版;《数据库原理及其应用教程》 黄德才等编著;科学出文献 版社;2002年8月第1版等。 指导教师: 年 月 日 教研室主任: 年 月 日 目 录
引 言 .......................................................................................................................................................... 2 第1章 目的及意义 .................................................................................................................................... 3
目的 .................................................................................................................................................. 3
意义 .......................................................................................................................................... 3
第2章 相关技术简介 ................................................................................................................................ 4
系统相关技术简介 ........................................................................................................................... 4 .......................................................................................................................................................... 4
.................................................................................................................................................. 4 运行环境及硬软件要求 ........................................................................................................... 5 IIS的安装与配置 ..................................................................................................................... 5 .................................................................................................................................................. 6 SQL Server 2000简介 ...................................................................................................................... 6 HTML技术简介 .............................................................................................................................. 6 第3章 需求分析和总体设计 ..................................................................................................................... 8
系统需求分析 .................................................................................................................................. 8 系统总体设计 .................................................................................................................................. 9 第4章 系统功能设计及实现功能代码 .................................................................................................... 11
登录界面 ......................................................................................................................................... 11 查询学校区域界面 ......................................................................................................................... 13 寻找学校界面 ................................................................................................................................ 15 班级通讯录界面: ......................................................................................................................... 17 第5章 系统使用说明 .............................................................................................................................. 19 结 论 ........................................................................................................................................................ 20 致 谢 ........................................................................................................................................................ 21 参考文献 .................................................................................................................................................... 22
引 言
目前,经济发展迅猛,人们的压力也越来越大,以致把大多数的时间都投入在工作上,往往就会淡忘以前的生活。学生时代是梦想最多的时代,感情最纯真的时代,在那时,我们都会遇到很多不同的人,也交了很多知己。但是一走上工作岗位,大多数人都会与以前的朋友失去联系。有时,即使想联系却没有联系方式。通过校友录系统,可以找到想要联系的朋友,这是许多人都认可的,可以看出设计一个校友录是极具可行性的。
校友录是为了方便校友之间联系而使用的一种系统。本论文主要介绍了一个同学录系统的实现过程:主要包括系统的需求分析、系统设计、以及主要模块的详细设计。主要模块的详细设计主要包括:用户注册和登陆模块、留言模块、查询模块等。
本课题是基于Windows 2000环境的数据库管理,该系统前台使用Microsoft Visual Studio (C#语言)技术进行开发,后台数据库采用SQL Server 2000,并通过IIS进行发布,属于WEB数据库开发、用于解决实际问题的实例,具有一定的深度,涉及到数据库设计和前端开发工具的开发和设计,与之相似的应用很广泛。
Server 2000数据库及其相关的一些知识,着重论述数据库中间技术,并将其放入一个简单的体系中加以实现。
具体的实现是构造一个校友录管理系统,用户以个人的身份进入,查找满足条件的班级,并可以填写个人资料,以便被查询。通过校友录这种网络联系方式,可以让很多因毕业而分离的同学们还能够经常聚首,互相嘘寒问暖,了解各自的近况,还可以建立毕业生和在校生的沟通渠道,增强学校的凝聚力,能很方便的和同学沟通和交流。
第1章 目的及意义
目的
本系统的题目是:《校友录管理系统》 1. 、语法、服务器控件等问题 。
2. 实现班级管理、班级同学注册登陆、同学留言、班级相册、 。 3. 分析并解决实现中的若干技术问题。
4. 建立完整的网上班级同学录,进行测试并分析结果。
5. 通过实训达到熟练灵活地使用C#语言,掌握ASP.NET应用的基本技能SQL Server数据库的相关操作。
意义
1. 通过校友录这个平台,让所有人充分利用网络,利用更先进、更流行的方式找到自己的母校,找到以前的老师与同学的准确信息,以便联系。找回学生时代的感觉,回忆校园的美好时光。同时,可以发表文章,问候老师与同学们,还可以已有的文章进行评论、留言等。这就为在校或已毕业的广大校友们提供一份交流思想的场所,通过提供完善的校友录服务和规范校友录的管理,建立起校友之间的沟通渠道,以达到增进校友之间、校友与母校之间的感情,方便校友联系的目的,从而增强学校的凝聚力。
2. 也希望通过此次毕业设计实践,,SQL Server 2000数据库及其它相关技术的了解,也是对所学知识的综合运用,愿我国计算机界总体水平迅速提高。
第2章 相关技术简介
系统相关技术简介
主要技术:, SQL Server 2000数据库,HTML
Framework基础之上的程序设计框架,它用来创建Web应用程序。 Web应用程
序的一部分,它为创建动态Web站点提供了简易的方法。 Web Service的必要技术,它提供组件来创建基于Web的颁布式应用程序。
它包括五大对象:Request对象、Response对象、Application对象、Session对象和Server对象。
Web应用程序的组成部分:(提供用户接口);代码隐藏页(包含Web窗体的服务器代码);配置文件();(应用程序集事件做出响应的必要代码);XML Web Service链接(发送和接收数据),高速缓存(在第一次请求后更快地返回Web窗体和数据)。
Web应用程序包括不同的部分和组件。 Web应用程序涉及使用它的所有组件部分和组件,并使用起正常运转。如图1-1所示:
图 1-1 Web应用程序组成
运行环境及硬软件要求
运行环境: 操作系统:Windows 2000 Server
开发环境:Microsoft Visual Studio 2005 ,SQL server 2000 运行环境:Windows系统, IE浏览器
硬软件要求:CPU Pentium II 450以上;
内存 256M以上, 推荐 512M; 硬盘空间 1G 或者更多;
操作系统 Windows 2000 Server,并安装 IIS。
IIS的安装与配置
若操作系统中还未安装IIS服务器,可打开“控制面板”,然后单击启动 “添加/删除程序”, 在弹出的对话框中选择 “添加/删除Windows组件”,在Windows组件向导对话框中选中“Internet信息服务(IIS)”,然后单击“下一步”,按向导指示,完成对IIS的安装。
(CLR)上的应用程序框架。他用来在服务器端构建功能强大的Web应用程序。:增强的性能;世界级水平的开发工具支持;强大而富有弹性;简单;易于管理;可伸缩性和有效利用性;可订制和扩展;安全性。
SQL Server 2000简介
SQL Server数据库是有组织的数据的集合,这种数据集合具有逻辑结构并得到数据库系统的管理和维护。SQL Server数据库是数据库对象的容器,它以操作系统文件的形式存储在磁盘上。
Microsoft SQL Server 2000是一个高性能的客户端/服务器结构的关系数据库管理系统(RDBMS,Relational Database Management System)。SQL Server 2000是为支持高容量的事务处理(比如在线订购录入、存货记录、记账或制造)以及数据仓库和决策支持系统(比如销售分析应用)而设计的。它运行在Microsoft Windows NT4或Microsoft Windows 2000 Server上——基于使用Intel处理器的网络。可以把SQL Server 2000作为一种个人桌面数据库系统安装在运行Windows NT Workstation 4、Windows 2000 Professional、Windows 98 和Windows Millennium Edition(Me)的机器上。可以使用相同的CD来安装任何一个SQL Server 2000的服务器版本或者个人版本。另外,还可以在同一台计算机上安装多个SQL Server 2000实例,每个实例都有各自的一套用户和数据。
SQL Server 2000数据库文件的三种类型:主数据文件(Primary file);辅助数据文件(Secondary file);事务日志文件(Transaction log)。
SQL Server 2000实际上有七种不同的可用版本:Standard Edition、Enterprise Edition、Personal Edition、Developer Edition、Windows CE Edition、Evaluation Edition和Microsoft Desktop Engine(MSDE),它们分别在不同的CD上。
SQL Server 2000也能够为其他的Microsoft操作系统,比如Windows ,提供很多客户端工具和网络接口。由于SQL Server的开放结构,其他的系统(如基于UNIX的系统)也能够和它交互操作。
HTML技术简介
HTML(Hyper Text Markup Language 超文本标记语言)是一种用来制作超文本文档的简单标记语言。用HTML编写的超文本文档称为HTML文档,它能于各种操作系统平台(如UNIX,WINDOWS等)。自1990年以来HTML就一直被用作World Wide
Web上的信息表示语言,用于描述Homepage的格式设计和它与WWW上其它Homepage的连结信息。
HTML语言是通过利用各种标记来标识文档的结构以及标识超链(Hyperlink)的信息。HTML文档(即Homepage的源文件)是一个放置了标记的ASCII文本文件,。
目前,,它是基于SGML(Standard Generalized Markup Language,标准广义置标语言,是一套用来描述数字化文档的结构并管理其内容的复杂的规范)中的一个子集演变而来的。
第3章 需求分析和总体设计
系统需求分析
所谓系统需求分析,通俗地说就是在系统还没开始设计之前,首先做个调查,了解用户对该系统的实际需求,然后分析该系统要达到的预期目标,最后才开始设计该系统。一个系统能够使用方便、易懂,可维护性强,扩展功能好, 系统安全性高,信息交流广泛,能够满足用户的需求,真正得到用户的认可并能推广它,被多数人赞许才算得上是一个好系统。
用户需求调查工作做好了,就要开始分析本系统的具体设计方案。首先要做的工作是根据调查用户需求报告来创建数据库,创建表,列出表中字段等一系列的数据库工作,随后就是做系统的整体设计。具体系统流程图如图3-1所示:
根据需求调查得出的结论如下: 一、班级管理员对功能的需求
班级成员信息管理:可浏览班级所有成员的信息,并审核要求成为班级成员的用户信息。
留言信息管理:可浏览、添加,并维护所有班级成员留言的信息。 二、班级用户对功能的需求:
申请加入班级管理:用户找到所在班级后可申请加入此班级。 个人信息管理:可注册、修改个人信息。 留言信息管理:可浏览、添加班级留言信息,
班级成员信息的浏览:用户可浏览班级所有用户的信息。
图 5-1 系统流程图
系统总体设计
校友录系统开发的目的是实现校友之间的信息交流。具有用户注册、用户信息修改、用户登录、创建学校、创建班级的功能,还包括加入班级成员,查看班级成员的信息和校友信息留言功能。本系统要求具有以下功能:具体如图3-2所示:
(1)用户注册:用户注册是校友录系统使用的第一步,也就是说必须为系统用户后才可以在校友录中进行其他操作。
(2)用户密码信息修改:用户在成为系统的注册用户后,还可以修改个人的密码信息。
(3)用户登录:由于此系统设计了不同权限的用户,因此需要用户进行登录设置,来区分用户的权限。
(4)创建学校:在校友录系统中,如果注册用户的学校不存在,用户可以在校友录系统中创建自己的母校。
(5)创建班级:在校友录系统中,如果注册用户所在的班级不存在,用户可以在校友录中创建所在班级信息,此时用户会自动成为班级的管理员。
(6)申请加入班级:如果用户所在班级的信息已经建立,注册用户可以申请加入此班级。
(7)信息留言管理:可以浏览班级成员的留言信息,并可以发布留言信息。
图 3-1 系统总体模块
第4章 系统功能设计及实现功能代码
登录界面
如图4-1所示。在此界面中,用户可以输入正确的用户名和密码进行登录,若未注册,可点击注册再输入正确的个人信息,待成功后即可登录。
图 4-1 登录界面
前台界面中,主要定义了一个可链接到各个省、自治区、直辖市的中国地图,点击一下就会自动链接到查询学校区域界面,并在学校所在地区的下拉列表框中填充与其相连的各下属地区;两个文本框,分别可输入用户名和密码;一个Label(IblMsg),它相当于验证控件。当用户名或者密码与数据库中的相应记录不一致时,该控件就会显示“用户名或口令有错!请重新输入!”。
页面初始化事件:
下面的代码中定义了登录界面初始化事件。输入用户名、密码和lblMsg文本框都
为空,让用户自行输入登录信息。其实现代码如下:
if (!)
{ = \"\"; = \"\"; = \"\";
}
定义登录按钮事件:
下面的代码中定义了用户按“登录”按钮后所执行的操作。主要实现了连接本系统的school数据库,查询用户所输入的用户名与密码是否正确,如果数据库中scuser表中的login和pwd字段与用户输入的用户名和密码相同时,表示正确,就跳转到下一界面;如果不正确,则在lblMsg文本框中跳出“用户名或口令有错!请重新输入!”,并把密码框清空。其实现代码如下:
string sqlconn = [\"SQLConnectionString\"];
SqlConnection myConnection = new SqlConnection(sqlconn); string id = (); string pass = ();
string sql = \"select * from scuser where login='\" + id + \"'and password='\" + pass + \"'\"; SqlCommand cmd = new SqlCommand(sql, myConnection); ();
SqlDataReader rs = (); if (()) {
Session[\"uid\"] = rs[\"id\"].ToString(); (\"\"); } else {
= \"用户名或口令有错!请重新输入!\"; = \"\"; }
定义注册按钮事件:
下面的代码中定义了用户按“注册”按钮后所执行的操作。主要实现了若该用户未注册,则跳转到用户注册界面。其实现代码如下:
(\"\");
查询学校区域界面
如图4-2所示。在此界面中,用户要选择学校所在的区域、学校的类型作为查询学校信息的条件。
图 4-2 查询区域图
前台界面中,主要定义了两个DropDownList控件,这两个控件分别用于显示学生所在地区信息和学校类型信息,这两个控件中的数据都是从数据库中动态获取的,会随着数据库中数据的改变而动态变化。
页面初始化事件:
下面的代码中定义了查询学校区域界面初始化事件。主要实现了下拉列表框中学校所在地区和学校类型的数据添加。学校所在地区是由前面用户所选择省级范围后从数据
库中的city表中调用过来的,显示的地区就是该省级范围中的城市名称。学校类型是代码中添加的,包括大学、中学、大专、小学。其实现代码如下:
(\"请选择学校类型\"); (\"大 学\"); (\"中 学\"); (\"中 专\"); (\"小 学\");
strConn = [\"SQLConnectionString\"];
strSQL = \"select city_name from city where province_id=
\" + [\"pid\"].ToString();
cn = new SqlConnection(strConn); ();
cmd = new SqlCommand(strSQL, cn); dr = (); while (())
(dr[\"city_name\"].ToString());
定义下一步按钮事件:
下面的代码中定义了用户按“下一步”按钮后所执行的操作。主要实现了城市ID信息的获取,并将应用于查询学校信息的参数传递到下一界面中。其实现代码如下: strSQL = \"select city_id from city where city_name='\" + P1 + \"'\"; ();
cmd = new SqlCommand(strSQL, cn); dr = (); while (())
P1 = dr[0].ToString(); (); (); P2 = (); P3 = ();
(\"?cid=\" + P1 + \"&typ=\" + P2 + \"&kywd=\" + P3 + \"&pid=\" + [\"pid\"].ToString());
寻找学校界面
如图4-3所示。在此界面中,会显示符合地区和学校类型的学校信息,并可以在此界面中注册一个新的学校。
图 4-3 寻找学校
前台界面中,定义了一个DataGrid控件,此控件的学校名称列定义为HyperLinkColum,,分别用于添加校名、学校所在县市、邮政编码和网址信息。在此还定义了RequiredFieldValidator控件用于录入信息的验证操作。
页面初始化事件:
下面的代码中定义了用户信息列表界面初始化事件。主要实现了学校信息的查询操作,在此应用了一个复杂的查询操作,对4个数据表进行了操作,获取了学校的信息,其应用程序如下:
strSQL=\
strSQL += \" where =\" + [\"cid\"].ToString(); strSQL += \" and =\" + [\"typ\"].ToString();
strSQL += \" and =\" + [\"pid\"].ToString(); strSQL += \" and =\" + [\"cid\"].ToString(); strSQL += \" and =\" + [\"typ\"].ToString(); strSQL += \" and =\" + [\"pid\"].ToString();
strSQL += \" and like '%\" + [\"kywd\"].ToString() + \"%'\";
定义下一步按钮事件:
在下面的程序中定义了下一步按钮的触发事件,主要的作用是实现学校信息的添加操作。在程序中首先获取最大的学校ID值,并将此数值加1,然后应用Insert语句,向数据库中的school数据表添加一条学校的信息数据。
string sql = \"select max(sch_id)+1,count(*) from school\";
//获取最大的学校ID值并加1 strSQL = \"INSERT INTO
school(sch_name,province_id,city_id,sch_erea,type_id,sch_num,yb,sch_http,del_flag, sch_id,sch_who) VALUES('\";
//插入学校信息
定义查看按钮事件:
在下面的程序中定义了查看按钮的触发事件,主要的作用是查看学校名称是否已存在的操作。先链接数据库,找到school表中的sch_name字段,再与用户输入的学校名称进行对比,如果有一样的名字,则显示“昵称已被占用!”,如图4-5显示;如果不存在一样的名字,则显示“恭喜你!昵称可以使用!”,如图4-6显示。 DataTable dt = (DataTable)ViewState[\"table\"]; DataRow[] dr = (\"sch_name=\" + \"'\" + + \"'\"); if ( > 0)
{ (\"\"); return true; }
图 4-5 占用
if (!IfHaveName())
{(\"\");}
图 4-6 可用
班级通讯录界面:
。此界面主要用于显示班级成员的通讯信息,主要显示班级成员的电话、地址、邮编、E-mail等信息。
图 4-4 班级通讯录
在前台界面中,定义了DataList控件,应用此控件实现了学生信息的显示操作,本界面主要用来显示班级成员的姓名、生日、电话等信息。应用此控件可以添加表格,对页面进行规划,相对于DataGrid控件来说,此控件可以更好地美化页面。
初始化事件:
下面的代码中定义了班级通讯录界面初始化事件。主要实现了班级成员通讯信息的
获取,在Select查询语句中应用了Like函数进行模糊查询。查询数据结束后与DataList控件进行数据绑定,显示班级成员的通讯信息。 if (Session[\"uid\"].ToString() == \"\") (\"\");
string class_id = Request[\"class_id\"].ToString(); j = 5 - ;
SqlConnection myConnection = new SqlConnection(sqlconn); ();
strSQL = \"select * from scuser where class_id LIKE '%\" + class_id + \"%'\"; SqlDataAdapter comm = new SqlDataAdapter(strSQL, myConnection); DataSet ds = new DataSet(); (ds, \"list\");
= [\"list\"].DefaultView;
第5章 系统使用说明
一、登陆
每个用户在数据库中都有一条记录,可以使用login和password进行登陆,登陆后进入到用户功能页面,用户所有的功能都可以在这里完成。若被授权为管理员,则可以享用更多的功能,创建班级的用户自动设为管理员。若用户未注册,则进入注册界面,进行个人信息的填写。 二、使用
只要某用户加入了班级的校友录,且你已经成为这个校友录团体中的一员,你就可以在本系统中直接操作,还可根据导航栏进行操作。在校友录内部,在信息交流的过程中,用户既是传者又是受者,具有互换的含义。在信息发布和接受方面是相等的,都可以自由地发表言论等交流活动。也可以通过此系统与朋友联系,并且还能够创建学校和班级等功能。系统中班级管理为必不可少的模块项,主要是为了安全、有效地存储和管理登录本系统的用户信息,管理员可以进行更高层的操作,如对用户进行添加、删除、修改,对用户留言进行编辑、删除等,方便网站的管理与维护。
结 论
经过小组成员的共同努力,成功地完成了本次毕业实训。实训期间,我们先分工再做设计,在寝室也经常一起讨论,遇到问题时大家共同解决。不仅发扬了各自的团队精神,还增强了集体荣誉感,培养了沟通能力,这正是我们在工作中必须具备的,为以后的工作打下了良好的基础。
,。在此设计中,主要的技术有:,SQL Server 2000数据库等,将它们集成在一个Internet的环境中,从而实现了设计。
本系统是基于Web的一个功能较为全面,使用方便、简单、实用的网上同学信息交流管理系统。该系统结合平常了解到的班级同学的实际需求,实现了班级成员之间常用信息的共享、班级留言、班级通讯录、学校和班级的查询等功能。
平台虽基本实现了设计要求的功能,但存在很多不足和需要发展和改进的地方。 存在问题:本系统是一个应用型的设计,在技术上有目共睹,可是在设计的环节和细节上还存在着很多的不足。如平台的具体实现形式,具体功能的完善,界面的美化及友好等等,都是存在的问题,以后需加以改进。
收 获:总之,在这次毕业实训中,基本完成了预期所要达到的目的,也是对自己大学几年所学知识的综合运用,给自己在走上工作岗位前一次实际操练的机会。还能发现自己的不足之处,对自己的能力做出肯定,收获颇多。
致 谢
本论文从选题到完成的整个过程中,同学们都认真地完成各自的任务,老师对我们更是关怀备至。特别是我的指导老师——赵艳菲老师。无论是在学习上或是生活上,受到她的关心不少。毕业实训期间,曾多次亲自到寝室为我们指导设计,并仔细的提出论文修改意见,真的太感谢她了。她高尚的人格、亲和力和严谨的治学态度给我留下了深刻的印象。通过她的指导,不仅学到了很多文化知识,还明白了许多为人处事的道理。
感谢曾经教导过我的所有老师,没有他们的教导,就没有我的今天。我的知识都通过他们而传达给我,是他们让我感受到红烛的光芒与温暖,印证了“一日为师,终身为傅”这句话。
感谢我的同学们,在平时的生活中,你们像亲姐妹一样关心我;在学习中,特别是毕业设计过程中,每当我遇到困难你们都会耐心地帮我解决。
感谢我远方的父母和亲友,多年来你们对我无微不至的关怀,给我世上最无私的爱,给我最温暖的问候和最贴心的照顾。
最后,两次感谢所有在我成长的路上帮助过我的人,我将永生难忘!
参考文献
[1] 《Visual C# + SQL Server 数据库开发与实例》 李律松,马传宝,李婷等编著;清华大学出版社;2006年8月第1版;
[2] 《 案例教程》 赵增敏等编著;电子工业出版社;2007年7月第1版;
[3] 《信息系统开发实例精粹(C#版)》 汪孝宜,胡海璐等编著;电子工业出版社;2006年7月第1版;
[4] 《+SQL Server动态网站开发案例精选》 刘斌,张军等编著;清华大学出版社;2006年6月第1版;
[5] 《》 尹洪,古锋等编著;高等教育出版社;2006年6月第1版;
[6] 《 + SQL Server 2000网络应用系统开发安全精解》 张树亮,李超等编著;清华大学出版社;2006年9月第1版;
[7] 《数据库系统概论》 萨师煊,王珊等编著;北京高等教育出版社;1997年9月第1版;
[8] 《数据库程序设计—SQL Server 2000数据库程序设计》 尹洪,叶波等编著;高等教育出版社;2004年2月第1版;
[9] 《数据库原理及其应用教程》 黄德才等编著;科学出版社;2002年8月第1版; [10]《SQL Server 2000企业级数据库的安装、配置和管理》 刘志鹏,朱之文等编著;高等教育出版社;2003年8月第1版;
校友录管理系统
学生姓名 专业班级 指导教师 完成日期
任务书
学生姓名 课题名称 指导教师 指导教师 指导教师 班级 学号 课题组人数 职称 职称 职称 校友录管理系统 实 训 任 务 及 要 求 四、 实训目标 通过实训达到熟练灵活地使用C#语言,掌握ASP.NET应用的基本技能及SQL Server数据库的相关操作。 五、 实训内容 校友录系统开发的目的是实现校友之间的信息交流。具有创建学校、创建班级的功能,还包括加入班级成员,查看班级成员的信息和校友信息留言功能。本系统要求具有以下功能: 2. 班级管理员对功能的需求 (1)班级成员信息管理:可浏览班级所有成员的信息,并审核要求成为班级成员的用户信息。 (2)留言信息管理:可浏览、添加,并维护所有班级成员留言的信息。 2.班级用户对功能的需求 (1)申请加入班级管理:用户找到所在班级后可申请加入此班级。 (2)个人信息管理:可注册、修改个人信息。 3.系统管理 (1)用户登录:用于登录系统,并划分用户的权限。 (2)用户信息管理:查看注册、修改用户信息。 (3)学校信息管理:查找一个学校或创建一个新学校。 (4)班级信息管理:查找一个班级或创建一个新班级。 (5)加入班级信息管理:申请加入一个班级。 (6)班级成员信息管理:审核班级成员的信息。 (7)信息留言管理:普通班级成员可添加留言信息。 六、 开发环境 开发平台:Microsoft Visual Studio 2005,语言:C#,数据库:SQL Server 2000 一、对用户登录界面()进行设计及美化。 学生需二、对班级通讯录界面()进行设计及美化。 完三、对班级注册界面的查询学校所在区域界面()进行设计及美化。 成的具四、对班级注册界面的寻找学校界面()进行设计及美化。 体任务 五、协助小组成员,进行各界面的美化、设计工作。 《Visual C# + SQL Server 数据库开发与实例》 李律松,马传宝,李婷等编著;清华 学出版社;2006年8月第1版;《数据库原理及其应用教程》 黄德才等编著;科学出文献 版社;2002年8月第1版等。 指导教师: 年 月 日 教研室主任: 年 月 日 目 录
引 言 .................................................................................................................................................................. 2 第1章 目的及意义 ............................................................................................................................................. 3
目的........................................................................................................................................................... 3
意义 ................................................................................................................................................... 3
第2章 相关技术简介 ......................................................................................................................................... 4
系统相关技术简介 ................................................................................................................................... 4 .................................................................................................................................................................. 4
........................................................................................................................................................... 4 运行环境及硬软件要求 ................................................................................................................... 5 IIS的安装与配置 ............................................................................................................................. 5 ........................................................................................................................................................... 6 SQL Server 2000简介 .............................................................................................................................. 6 HTML技术简介 ...................................................................................................................................... 6 第3章 需求分析和总体设计 ............................................................................................................................. 8
系统需求分析 ........................................................................................................................................... 8 系统总体设计 ........................................................................................................................................... 9 第4章 系统功能设计及实现功能代码 ........................................................................................................... 11
登录界面 ................................................................................................................................................. 11 查询学校区域界面 ................................................................................................................................. 13 寻找学校界面 ......................................................................................................................................... 15 班级通讯录界面: ................................................................................................................................. 17 第5章 系统使用说明 ....................................................................................................................................... 19 结 论 ................................................................................................................................................................ 20 致 谢 ................................................................................................................................................................ 21 参考文献............................................................................................................................................................. 22
引 言
目前,经济发展迅猛,人们的压力也越来越大,以致把大多数的时间都投入在工作上,往往就会淡忘以前的生活。学生时代是梦想最多的时代,感情最纯真的时代,在那时,我们都会遇到很多不同的人,也交了很多知己。但是一走上工作岗位,大多数人都会与以前的朋友失去联系。有时,即使想联系却没有联系方式。通过校友录系统,可以找到想要联系的朋友,这是许多人都认可的,可以看出设计一个校友录是极具可行性的。
校友录是为了方便校友之间联系而使用的一种系统。本论文主要介绍了一个同学录系统的实现过程:主要包括系统的需求分析、系统设计、以及主要模块的详细设计。主要模块的详细设计主要包括:用户注册和登陆模块、留言模块、查询模块等。
本课题是基于Windows 2000环境的数据库管理,该系统前台使用Microsoft Visual Studio (C#语言)技术进行开发,后台数据库采用SQL Server 2000,并通过IIS进行发布,属于WEB数据库开发、用于解决实际问题的实例,具有一定的深度,涉及到数据库设计和前端开发工具的开发和设计,与之相似的应用很广泛。
Server 2000数据库及其相关的一些知识,着重论述数据库中间技术,并将其放入一个简单的体系中加以实现。
具体的实现是构造一个校友录管理系统,用户以个人的身份进入,查找满足条件的班级,并可以填写个人资料,以便被查询。通过校友录这种网络联系方式,可以让很多因毕业而分离的同学们还能够经常聚首,互相嘘寒问暖,了解各自的近况,还可以建立毕业生和在校生的沟通渠道,增强学校的凝聚力,能很方便的和同学沟通和交流。
第1章 目的及意义
目的
本系统的题目是:《校友录管理系统》 1. 、语法、服务器控件等问题 。
2. 实现班级管理、班级同学注册登陆、同学留言、班级相册、 。 3. 分析并解决实现中的若干技术问题。
4. 建立完整的网上班级同学录,进行测试并分析结果。
5. 通过实训达到熟练灵活地使用C#语言,掌握ASP.NET应用的基本技能SQL Server数据库的相关操作。
意义
1. 通过校友录这个平台,让所有人充分利用网络,利用更先进、更流行的方式找到自己的母校,找到以前的老师与同学的准确信息,以便联系。找回学生时代的感觉,回忆校园的美好时光。同时,可以发表文章,问候老师与同学们,还可以已有的文章进行评论、留言等。这就为在校或已毕业的广大校友们提供一份交流思想的场所,通过提供完善的校友录服务和规范校友录的管理,建立起校友之间的沟通渠道,以达到增进校友之间、校友与母校之间的感情,方便校友联系的目的,从而增强学校的凝聚力。
2. 也希望通过此次毕业设计实践,,SQL Server 2000数据库及其它相关技术的了解,也是对所学知识的综合运用,愿我国计算机界总体水平迅速提高。
第2章 相关技术简介
系统相关技术简介
主要技术:, SQL Server 2000数据库,HTML
Framework基础之上的程序设计框架,它用来创建Web应用程序。 Web
应用程序的一部分,它为创建动态Web站点提供了简易的方法。 Web Service的必要技术,它提供组件来创建基于Web的颁布式应用程序。
它包括五大对象:Request对象、Response对象、Application对象、Session对象和Server对象。
Web应用程序的组成部分:(提供用户接口);代码隐藏页(包含Web窗体的服务器代码);配置文件();(应用程序集事件做出响应的必要代码);XML Web
Service链接(发送和接收数据),高速缓存(在第一次请求后更快地返回Web窗体和数据)。
Web应用程序包括不同的部分和组件。 Web应用程序涉及使用它的所有组件部分和组件,并使用起正常运转。如图1-1所示:
图 1-1 Web应用程序组成
运行环境及硬软件要求
运行环境: 操作系统:Windows 2000 Server
开发环境:Microsoft Visual Studio 2005 ,SQL server 2000 运行环境:Windows系统, IE浏览器
硬软件要求:CPU Pentium II 450以上;
内存 256M以上, 推荐 512M; 硬盘空间 1G 或者更多;
操作系统 Windows 2000 Server,并安装 IIS。
IIS的安装与配置
若操作系统中还未安装IIS服务器,可打开“控制面板”,然后单击启动 “添加/删除程序”, 在弹出的对话框中选择 “添加/删除Windows组件”,在Windows组件向导对话框中选中“Internet信息服务(IIS)”,然后单击“下一步”,按向导
指示,完成对IIS的安装。
(CLR)上的应用程序框架。他用来在服务器端构建功能强大的Web应用程序。:增强的性能;世界级水平的开发工具支持;强大而富有弹性;简单;易于管理;可伸缩性和有效利用性;可订制和扩展;安全性。
SQL Server 2000简介
SQL Server数据库是有组织的数据的集合,这种数据集合具有逻辑结构并得到数据库系统的管理和维护。SQL Server数据库是数据库对象的容器,它以操作系统文件的形式存储在磁盘上。
Microsoft SQL Server 2000是一个高性能的客户端/服务器结构的关系数据库管理系统(RDBMS,Relational Database Management System)。SQL Server 2000是为支持高容量的事务处理(比如在线订购录入、存货记录、记账或制造)以及数据仓库和决策支持系统(比如销售分析应用)而设计的。它运行在Microsoft Windows NT4或Microsoft Windows 2000 Server上——基于使用Intel处理器的网络。可以把SQL Server 2000作为一种个人桌面数据库系统安装在运行Windows NT Workstation 4、Windows 2000 Professional、Windows 98 和Windows Millennium Edition(Me)的机器上。可以使用相同的CD来安装任何一个SQL Server 2000的服务器版本或者个人版本。另外,还可以在同一台计算机上安装多个SQL Server 2000实例,每个实例都有各自的一套用户和数据。
SQL Server 2000数据库文件的三种类型:主数据文件(Primary file);辅助数据文件(Secondary file);事务日志文件(Transaction log)。
SQL Server 2000实际上有七种不同的可用版本:Standard Edition、Enterprise Edition、Personal Edition、Developer Edition、Windows CE Edition、Evaluation Edition和Microsoft Desktop Engine(MSDE),它们分别在不同的CD上。
SQL Server 2000也能够为其他的Microsoft操作系统,比如Windows ,提供很多客户端工具和网络接口。由于SQL Server的开放结构,其他的系统(如基于UNIX的系统)也能够和它交互操作。
HTML技术简介
HTML(Hyper Text Markup Language 超文本标记语言)是一种用来制作超
文本文档的简单标记语言。用HTML编写的超文本文档称为HTML文档,它能于各种操作系统平台(如UNIX,WINDOWS等)。自1990年以来HTML就一直被用作World Wide Web上的信息表示语言,用于描述Homepage的格式设计和它与WWW上其它Homepage的连结信息。
HTML语言是通过利用各种标记来标识文档的结构以及标识超链(Hyperlink)的信息。HTML文档(即Homepage的源文件)是一个放置了标记的ASCII文本文件,。
目前,,它是基于SGML(Standard Generalized Markup Language,标准广义置标语言,是一套用来描述数字化文档的结构并管理其内容的复杂的规范)中的一个子集演变而来的。
第3章 需求分析和总体设计
系统需求分析
所谓系统需求分析,通俗地说就是在系统还没开始设计之前,首先做个调查,了解用户对该系统的实际需求,然后分析该系统要达到的预期目标,最后才开始设计该系统。一个系统能够使用方便、易懂,可维护性强,扩展功能好, 系统安
全性高,信息交流广泛,能够满足用户的需求,真正得到用户的认可并能推广它,被多数人赞许才算得上是一个好系统。
用户需求调查工作做好了,就要开始分析本系统的具体设计方案。首先要做的工作是根据调查用户需求报告来创建数据库,创建表,列出表中字段等一系列的数据库工作,随后就是做系统的整体设计。具体系统流程图如图3-1所示:
根据需求调查得出的结论如下: 一、班级管理员对功能的需求
班级成员信息管理:可浏览班级所有成员的信息,并审核要求成为班级成员的用户信息。
留言信息管理:可浏览、添加,并维护所有班级成员留言的信息。 二、班级用户对功能的需求:
申请加入班级管理:用户找到所在班级后可申请加入此班级。 个人信息管理:可注册、修改个人信息。 留言信息管理:可浏览、添加班级留言信息,
班级成员信息的浏览:用户可浏览班级所有用户的信息。
图 5-1 系统流程图
系统总体设计
校友录系统开发的目的是实现校友之间的信息交流。具有用户注册、用户信息修改、用户登录、创建学校、创建班级的功能,还包括加入班级成员,查看班级成员的信息和校友信息留言功能。本系统要求具有以下功能:具体如图3-2所示:
(1)用户注册:用户注册是校友录系统使用的第一步,也就是说必须为系统用户后才可以在校友录中进行其他操作。
(2)用户密码信息修改:用户在成为系统的注册用户后,还可以修改个人的密
码信息。
(3)用户登录:由于此系统设计了不同权限的用户,因此需要用户进行登录设置,来区分用户的权限。
(4)创建学校:在校友录系统中,如果注册用户的学校不存在,用户可以在校友录系统中创建自己的母校。
(5)创建班级:在校友录系统中,如果注册用户所在的班级不存在,用户可以在校友录中创建所在班级信息,此时用户会自动成为班级的管理员。
(6)申请加入班级:如果用户所在班级的信息已经建立,注册用户可以申请加入此班级。
(7)信息留言管理:可以浏览班级成员的留言信息,并可以发布留言信息。
图 3-1 系统总体模块
第4章 系统功能设计及实现功能代码
登录界面
如图4-1所示。在此界面中,用户可以输入正确的用户名和密码进行登录,若未注册,可点击注册再输入正确的个人信息,待成功后即可登录。
图 4-1 登录界面
前台界面中,主要定义了一个可链接到各个省、自治区、直辖市的中国地图,点击一下就会自动链接到查询学校区域界面,并在学校所在地区的下拉列表框中填充与其相连的各下属地区;两个文本框,分别可输入用户名和密码;一个Label(IblMsg),它相当于验证控件。当用户名或者密码与数据库中的相应记录不一致时,该控件就会显示“用户名或口令有错!请重新输入!”。
页面初始化事件:
下面的代码中定义了登录界面初始化事件。输入用户名、密码和lblMsg文本框都为空,让用户自行输入登录信息。其实现代码如下:
if (!)
{ = \"\"; = \"\"; = \"\";
}
定义登录按钮事件:
下面的代码中定义了用户按“登录”按钮后所执行的操作。主要实现了连接本系统的school数据库,查询用户所输入的用户名与密码是否正确,如果数据库中scuser表中的login和pwd字段与用户输入的用户名和密码相同时,表示正确,就跳转到下一界面;如果不正确,则在lblMsg文本框中跳出“用户名或口令有错!请重新输入!”,并把密码框清空。其实现代码如下:
string sqlconn = [\"SQLConnectionString\"];
SqlConnection myConnection = new SqlConnection(sqlconn); string id = (); string pass = ();
string sql = \"select * from scuser where login='\" + id + \"'and password='\" + pass
+ \"'\";
SqlCommand cmd = new SqlCommand(sql, myConnection); ();
SqlDataReader rs = (); if (()) {
Session[\"uid\"] = rs[\"id\"].ToString(); (\"\"); } else {
= \"用户名或口令有错!请重新输入!\"; = \"\"; }
定义注册按钮事件:
下面的代码中定义了用户按“注册”按钮后所执行的操作。主要实现了若该用户未注册,则跳转到用户注册界面。其实现代码如下:
(\"\");
查询学校区域界面
如图4-2所示。在此界面中,用户要选择学校所在的区域、学校的类型作为查询学校信息的条件。
图 4-2 查询区域图
前台界面中,主要定义了两个DropDownList控件,这两个控件分别用于显示学生所在地区信息和学校类型信息,这两个控件中的数据都是从数据库中动态获取的,会随着数据库中数据的改变而动态变化。
页面初始化事件:
下面的代码中定义了查询学校区域界面初始化事件。主要实现了下拉列表框中学校所在地区和学校类型的数据添加。学校所在地区是由前面用户所选择省级范围后从数据库中的city表中调用过来的,显示的地区就是该省级范围中的城市名称。学校类型是代码中添加的,包括大学、中学、大专、小学。其实现代码如下:
(\"请选择学校类型\");
(\"大 学\"); (\"中 学\"); (\"中 专\"); (\"小 学\");
strConn = [\"SQLConnectionString\"];
strSQL = \"select city_name from city where province_id=
\" + [\"pid\"].ToString();
cn = new SqlConnection(strConn); ();
cmd = new SqlCommand(strSQL, cn); dr = (); while (())
(dr[\"city_name\"].ToString());
定义下一步按钮事件:
下面的代码中定义了用户按“下一步”按钮后所执行的操作。主要实现了城市ID信息的获取,并将应用于查询学校信息的参数传递到下一界面中。其实现代码如下:
strSQL = \"select city_id from city where city_name='\" + P1 + \"'\"; ();
cmd = new SqlCommand(strSQL, cn); dr = (); while (())
P1 = dr[0].ToString(); (); (); P2 = (); P3 = ();
(\"?cid=\" + P1 + \"&typ=\" + P2 + \"&kywd=\" + P3 + \"&pid=\" +
[\"pid\"].ToString());
寻找学校界面
如图4-3所示。在此界面中,会显示符合地区和学校类型的学校信息,并可以在此界面中注册一个新的学校。
图 4-3 寻找学校
前台界面中,定义了一个DataGrid控件,此控件的学校名称列定义为HyperLinkColum,,分别用于添加校名、学校所在县市、邮政编码和网址信息。在此还定义了RequiredFieldValidator控件用于录入信息的验证操作。
页面初始化事件:
下面的代码中定义了用户信息列表界面初始化事件。主要实现了学校信息的查询操作,在此应用了一个复杂的查询操作,对4个数据表进行了操作,获取了学校的信息,其应用程序如下:
strSQL=\
strSQL += \" where =\" + [\"cid\"].ToString(); strSQL += \" and =\" + [\"typ\"].ToString(); strSQL += \" and =\" + [\"pid\"].ToString(); strSQL += \" and =\" + [\"cid\"].ToString(); strSQL += \" and =\" + [\"typ\"].ToString(); strSQL += \" and =\" + [\"pid\"].ToString();
strSQL += \" and like '%\" + [\"kywd\"].ToString() + \"%'\";
定义下一步按钮事件:
在下面的程序中定义了下一步按钮的触发事件,主要的作用是实现学校信息的添加操作。在程序中首先获取最大的学校ID值,并将此数值加1,然后应用Insert语句,向数据库中的school数据表添加一条学校的信息数据。
string sql = \"select max(sch_id)+1,count(*) from school\";
//获取最大的学校ID值并加1 strSQL = \"INSERT INTO
school(sch_name,province_id,city_id,sch_erea,type_id,sch_num,yb,sch_http,del_flag,
sch_id,sch_who) VALUES('\";
//插入学校信息
定义查看按钮事件:
在下面的程序中定义了查看按钮的触发事件,主要的作用是查看学校名称是否已存在的操作。先链接数据库,找到school表中的sch_name字段,再与用户输入的学校名称进行对比,如果有一样的名字,则显示“昵称已被占用!”,如图4-5显示;如果不存在一样的名字,则显示“恭喜你!昵称可以使用!”,如图4-6显示。
DataTable dt = (DataTable)ViewState[\"table\"]; DataRow[] dr = (\"sch_name=\" + \"'\" + + \"'\"); if ( > 0)
{ (\"\"); return true; }
图 4-5 占用
if (!IfHaveName())
{(\"\");}
图 4-6 可用
班级通讯录界面:
。此界面主要用于显示班级成员的通讯信息,主要显示班级成员的电话、地址、邮编、E-mail等信息。
图 4-4 班级通讯录
在前台界面中,定义了DataList控件,应用此控件实现了学生信息的显示操作,本界面主要用来显示班级成员的姓名、生日、电话等信息。应用此控件可以添加表格,对页面进行规划,相对于DataGrid控件来说,此控件可以更好地美化页面。
初始化事件:
下面的代码中定义了班级通讯录界面初始化事件。主要实现了班级成员通讯信息的获取,在Select查询语句中应用了Like函数进行模糊查询。查询数据结束后与DataList控件进行数据绑定,显示班级成员的通讯信息。 if (Session[\"uid\"].ToString() == \"\") (\"\");
string class_id = Request[\"class_id\"].ToString(); j = 5 - ;
SqlConnection myConnection = new SqlConnection(sqlconn); ();
strSQL = \"select * from scuser where class_id LIKE '%\" + class_id + \"%'\"; SqlDataAdapter comm = new SqlDataAdapter(strSQL, myConnection); DataSet ds = new DataSet(); (ds, \"list\");
= [\"list\"].DefaultView;
第5章 系统使用说明
一、登陆
每个用户在数据库中都有一条记录,可以使用login和password进行登陆,登陆后进入到用户功能页面,用户所有的功能都可以在这里完成。若被授权为管理员,则可以享用更多的功能,创建班级的用户自动设为管理员。若用户未注册,则进入注册界面,进行个人信息的填写。 二、使用
只要某用户加入了班级的校友录,且你已经成为这个校友录团体中的一员,你就可以在本系统中直接操作,还可根据导航栏进行操作。在校友录内部,在信息交流的过程中,用户既是传者又是受者,具有互换的含义。在信息发布和接受方面是相等的,都可以自由地发表言论等交流活动。也可以通过此系统与朋友联系,并且还能够创建学校和班级等功能。系统中班级管理为必不可少的模块项,主要是为了安全、有效地存储和管理登录本系统的用户信息,管理员可以进行更高层的操作,如对用户进行添加、删除、修改,对用户留言进行编辑、删除等,方便网站的管理与维护。
结 论
经过小组成员的共同努力,成功地完成了本次毕业实训。实训期间,我们先分工再做设计,在寝室也经常一起讨论,遇到问题时大家共同解决。不仅发扬了各自的团队精神,还增强了集体荣誉感,培养了沟通能力,这正是我们在工作中必须具备的,为以后的工作打下了良好的基础。
,。在此设计中,主要的技术有:,SQL Server 2000数据库等,将它们集成在一个Internet的环境中,从而实现了设计。
本系统是基于Web的一个功能较为全面,使用方便、简单、实用的网上同学信息交流管理系统。该系统结合平常了解到的班级同学的实际需求,实现了班级成员之间常用信息的共享、班级留言、班级通讯录、学校和班级的查询等功能。
平台虽基本实现了设计要求的功能,但存在很多不足和需要发展和改进的地方。
存在问题:本系统是一个应用型的设计,在技术上有目共睹,可是在设计的环节和细节上还存在着很多的不足。如平台的具体实现形式,具体功能的完善,界面的美化及友好等等,都是存在的问题,以后需加以改进。
收 获:总之,在这次毕业实训中,基本完成了预期所要达到的目的,也是对自己大学几年所学知识的综合运用,给自己在走上工作岗位前一次实际操练的机会。还能发现自己的不足之处,对自己的能力做出肯定,收获颇多。
致 谢
本论文从选题到完成的整个过程中,同学们都认真地完成各自的任务,老师对我们更是关怀备至。特别是我的指导老师——赵艳菲老师。无论是在学习上或是生活上,受到她的关心不少。毕业实训期间,曾多次亲自到寝室为我们指导设计,并仔细的提出论文修改意见,真的太感谢她了。她高尚的人格、亲和力和严谨的治学态度给我留下了深刻的印象。通过她的指导,不仅学到了很多文化知识,还明白了许多为人处事的道理。
感谢曾经教导过我的所有老师,没有他们的教导,就没有我的今天。我的知识都通过他们而传达给我,是他们让我感受到红烛的光芒与温暖,印证了“一日为师,终身为傅”这句话。
感谢我的同学们,在平时的生活中,你们像亲姐妹一样关心我;在学习中,特别是毕业设计过程中,每当我遇到困难你们都会耐心地帮我解决。
感谢我远方的父母和亲友,多年来你们对我无微不至的关怀,给我世上最无私的爱,给我最温暖的问候和最贴心的照顾。
最后,两次感谢所有在我成长的路上帮助过我的人,我将永生难忘!
参考文献
[1] 《Visual C# + SQL Server 数据库开发与实例》 李律松,马传宝,李婷等编著;清华大学出版社;2006年8月第1版;
[2] 《 案例教程》 赵增敏等编著;电子工业出版社;2007年7月第1版; [3] 《信息系统开发实例精粹(C#版)》 汪孝宜,胡海璐等编著;电子工业出版社;2006年7月第1版;
[4] 《+SQL Server动态网站开发案例精选》 刘斌,张军等编著;清华大学出版社;2006年6月第1版;
[5] 《》 尹洪,古锋等编著;高等教育出版社;2006年6月第1版;
[6] 《 + SQL Server 2000网络应用系统开发安全精解》 张树亮,李超等编著;清华大学出版社;2006年9月第1版;
[7] 《数据库系统概论》 萨师煊,王珊等编著;北京高等教育出版社;1997年9月第1版;
[8] 《数据库程序设计—SQL Server 2000数据库程序设计》 尹洪,叶波等编著;高等教育出版社;2004年2月第1版;
[9] 《数据库原理及其应用教程》 黄德才等编著;科学出版社;2002年8月第1版;
[10]《SQL Server 2000企业级数据库的安装、配置和管理》 刘志鹏,朱之文等编著;高等教育出版社;2003年8月第1版;
r, but fainter now and desperately the horn was blowing. Fierce and shrill rose the yells of the Orcs, and suddenly the horn-calls ceased. Aragorn raced down the last slope, but before he could reach the hill's foot, the sounds died away; and as he turned to the left and ran towards them they retreated, until at last he could hear them no more. Drawing his bright sword and crying _Elendil! Elendil!_ he crashed through the trees.
A mile, maybe, from Parth Galen in a little glade not far from the lake he found Boromir. He was sitting with his back to a great tree, as if he was resting. But Aragorn saw that he was pierced with many black-feathered arrows; his sword was still in his hand, but it was broken near the hilt; his horn cloven in two was at his side. Many Orcs lay slain, piled all about him and at his feet.
Aragorn knelt beside him. Boromir opened his eyes and strove to speak. At last slow words came. 'I tried to take the Ring from Frodo ' he said. 'I am sorry. I have paid.' His glance strayed to his fallen enemies; twenty at least lay there. 'They have gone: the Halflings: the Orcs have taken them. I think they are not dead. Orcs bound them.' He paused and his eyes closed wearily. After a moment he spoke again.
'Farewell, Aragorn! Go to Minas Tirith and save my people! I have failed.'
'No!' said Aragorn, taking his hand and kissing his brow. 'You have conquered. Few have gained such a victory. Be at peace! Minas Tirith shall not fall!' Boromir smiled.
'Which way did they go? Was Frodo there?' said Aragorn. But Boromir did not speak again.
'Alas!' said Aragorn. 'Thus passes the heir of Denethor, Lord of the Tower of Guard! This is a bitter end. Now the Company is all in ruin. It is I that have failed. Vain was Gandalf's trust in me. What shall I do now? Boromir has laid it on me to go to Minas Tirith, and my heart desires it; but where are the Ring and the Bearer? How shall I find them and save the Quest from disaster?'
He knelt for a while, bent with weeping, still clasping Boromir's hand. So it was that Legolas and Gimli found him. They came from the western slopes of the hill, silently, creeping through the trees as if they were hunting. Gimli had his axe in hand, and Legolas his long knife: all his arrows were spent. When they came into the glade they halted in amazement; and then they stood a moment with heads bowed in grief, for it seemed to them plain what had happened.
'Alas!' said Legolas, coming to Aragorn's side. 'We have hunted and slain many Orcs in the woods, but we should have been of more use here. We came when we heard the horn-but too late, it seems. I fear you have taken deadly hurt.'
'Boromir is dead,' said Aragorn. 'I am unscathed, for I was not here with him. He fell defending the hobbits, while I was away upon the hill.' 'The hobbits!' cried Gimli 'Where are they then? Where is Frodo?'
'I do not know,' answered Aragorn wearily. 'Before he died Boromir told me that the Orcs had bound them; he did not think that they were dead. I sent him to follow Merry and Pippin; but I did not ask him if Frodo or Sam were with him: not until it was too late. All that I have done today has gone amiss. What is to be done now?' 'First we must tend the fallen,' said Legolas. 'We cannot leave him lying like carrion among these foul Orcs.'
'But we must be swift,' said Gimli. 'He would not wish us to linger. We must follow the Orcs, if there is hope that any of our Company are living prisoners.'
'But we do not know whether the Ring-bearer is with them or not ' said Aragorn. 'Are we to abandon him? Must we not seek him first? An evil choice is now before us!' 'Then let us do first what we must do,' said Legolas. 'We have not the time or the tools to bury our comrade fitly, or to raise a mound over him. A cairn we might build.' 'The labour would be hard and long: there are no stones that we could use nearer than the water-side,' said Gimli.
'Then let us lay him in a boat with his weapons, and the weapons of his vanquished foes,' said Aragorn. 'We will send him to the Falls of Rauros and give him to Anduin. The River of Gondor will take care at least that no evil creature dishonours his bones.'
Quickly they searched the bodies of the Orcs, gathering their swords and cloven helms and shields into a heap. 'See!' cried Aragorn. 'Here we find tokens!' He picked out from the pile of grim weapons two knives, leaf-bladed, damasked in gold and red; and searching further he found also the sheaths, black, set with small red gems. 'No orc-tools these!' he said. 'They were borne by the hobbits. Doubtless the Orcs despoiled them, but feared to keep the knives, knowing them for what they are: work of Westernesse, wound about with spells for the bane of Mordor. Well, now, if they still live, our friends are weaponless. I will take these things, hoping against hope, to give them back.'
'And I,' said Legolas, 'will take all the arrows that I can find, for my quiver is empty.' He searched in the pile and on the ground about and found not a few that were undamaged and longer in the shaft than such arrows as the Orcs were accustomed to use. He looked at them closely.
And Aragorn looked on the slain, and he said: 'Here lie many that are not folk of Mordor. Some are from the North, from the Misty Mountains, if I know anything of Orcs and their kinds. And here are others strange to me. Their gear is not after the manner of Orcs at all!'
There were four goblin-soldiers of greater stature, swart, slant-eyed, with thick legs and large hands. They were armed with short broad-bladed swords, not with the curved scimitars usual with Orcs: and they had bows of yew, in length and shape like the bows of Men. Upon their shields they bore a strange device: a small white hand in the centre of a black field; on the front of their iron helms was set an S-rune, wrought of some white metal.
'I have not seen these tokens before,' said Aragorn. 'What do they mean?' 'S is for Sauron,' said Gimli. 'That is easy to read.'
'Nay!' said Legolas. 'Sauron does not use the Elf-runes.'
'Neither does he use his right name, nor permit it to be spelt or spoken,' said Aragorn. 'And he does not use white. The Orcs in the service of Barad-d鹯 use the sign of the Red Eye.' He stood for a moment in thought. 'S is for Saruman, I guess,' he said at length. 'There is evil afoot in Isengard, and the West is no longer safe. It is as Gandalf feared: by some means the traitor Saruman has had news of our journey. It is likely too that he knows of Gandalf's fall. Pursuers from Moria may have escaped the vigilance of L髍ien, or they may have avoided that land and come to Isengard by other paths. Orcs travel fast. But Saruman has many ways of learning news. Do you remember the birds?' 'Well, we have no time to ponder riddles,' said Gimli. 'Let us bear Boromir away!'
'But after that we must guess the riddles, if we are to choose our course rightly,' answered Aragorn. 'Maybe there is no right choice,' said Gimli.
Taking his axe the Dwarf now cut several branches. These they lashed together with bowstrings, and spread their cloaks upon the frame. Upon this rough bier they carried the body of their companion to the shore, together with such trophies of his last battle as they chose to send forth with him. It was only a short way, yet they found it no easy task, for Boromir was a man both tall and strong.
At the water-side Aragorn remained, watching the bier. while Legolas and Gimli hastened back on foot to Parth Galen. It was a mile or more, and it was some time before they came back, paddling two boats swiftly along the shore.
'There is a strange tale to tell!' said Legolas. 'There are only two boats upon the bank. We could find no trace of the other.' 'Have Orcs been there?' asked Aragorn.
'We saw no signs of them,' answered Gimli. 'And Orcs would have taken or destroyed all the boats, and the baggage as well.' 'I will look at the ground when we come there,' said Aragorn.
Now they laid Boromir in the middle of the boat that was to bear him away. The grey hood and elven-cloak they folded and placed beneath his head. They combed his long dark hair and arrayed it upon his shoulders. The golden belt of L髍ien gleamed about his waist. His helm they set beside him, and across his lap they laid the cloven horn and the hilts and shards of his sword; beneath his feet they put the swords of his enemies. Then fastening the prow to the stern of the other boat, they drew him out into the water. They rowed sadly along the shore, and turning into the swift-running channel they passed the green sward of Parth Galen. The steep sides of Tol Brandir were glowing: it was now mid-afternoon. As they went south the fume of Rauros rose and shimmered before them, a haze of gold. The rush and thunder of the falls shook the windless air.
Sorrowfully they cast loose the funeral boat: there Boromir lay, restful, peaceful, gliding upon the bosom of the flowing water. The stream took him while they held their own boat back with their paddles. He floated by them, and slowly his boat departed, waning to a dark spot against the golden light; and then suddenly it vanished. Rauros roared on unchanging. The River had taken Boromir son of Denethor, and he was not seen again in Minas Tirith, standing as he used to stand upon the White Tower in the morning. But in Gondor in after-days it long was said that the elven-boat rode the falls and the foaming pool, and bore him down through Osgiliath, and past the many mouths of Anduin, out into the Great Sea at night under the stars.
For a while the three companions remained silent, gazing after him. Then Aragorn spoke. 'They will look for him from the White Tower,' he said, 'but he will not return from mountain or from sea.' Then slowly he began to sing:
Through Rohan over fen and field where the long grass grows The West Wind comes walking, and about the walls it goes.
'What news from the West, O wandering wind, do you bring to me tonight? Have you seen Boromir the Tall by moon or by starlight?' 'I saw him ride over seven streams, over waters wide and grey; I saw him walk in empty lands, until he passed away Into the shadows of the North. I saw him then no more.
The North Wind may have heard the horn of the son of Denethor.' 'O Boromir! From the high walls westward I looked afar, But you came not from the empty lands where no men are.'
Then Legolas sang:
From the mouths of the Sea the South Wind flies, from the sandhills and the stones; The wailing of the gulls it bears, and at the gate it moans.
'What news from the South, O sighing wind, do you bring to me at eve? Where now is Boromir the Fair? He tarries and I grieve.'
'Ask not of me where he doth dwell-so many bones there lie On the white shores and the dark shores under the stormy sky; So many have passed down Anduin to find the flowing Sea. Ask of the North Wind news of them the North Wind sends to me!' 'O Boromir! Beyond the gate the seaward road runs south, But you came not with the wailing gulls from the grey sea's mouth.'
Then Aragorn sang again:
From the Gate of Kings the North Wind rides, and past the roaring falls; And clear and cold about the tower its loud horn calls.
'What news from the North, O mighty wind, do you bring to me today? What news of Boromir the Bold? For he is long away.' 'Beneath Amon Hen I heard his cry. There many foes he fought. His cloven shield, his broken sword, they to the water brought. His head so proud, his face so fair, his limbs they laid to rest; And Rauros, golden Rauros-falls, bore him upon its breast.' 'O Boromir! The Tower of Guard shall ever northward gaze To Rauros, golden Rauros-falls, until the end of days.'
So they ended. Then they turned their boat and drove it with all the speed they could against the stream back to Parth Galen. 'You left the East Wind to me,' said Gimli, 'but I will say naught of it.'
'That is as it should be,' said Aragorn. 'In Minas Tirith they endure the East Wind, but they do not ask it for tidings. But now Boromir has taken his road. and we must make haste to choose our own.' He surveyed the green lawn, quickly but thoroughly, stooping often to the earth. 'The Orcs have been on this ground,' he said. 'Otherwise nothing can be made out for certain. All our footprints are here, crossing and re-crossing. I cannot tell whether any of the hobbits have come back since the search for Frodo began.' He returned to the bank, close to where the rill from the spring trickled out into the River. 'There are some clear prints here,' he said. 'A hobbit waded out into the water and back; but I cannot say how long ago.' 'How then do you read this riddle?' asked Gimli.
Aragorn did not answer at once, but went back to the camping-place and looked at the baggage. 'Two packs are missing.' he said, 'and one is certainly Sam's: it was rather large and heavy. This then is the answer: Frodo has gone by boat, and his servant has gone with him. Frodo must have returned while we were all away. I met Sam going up the hill and told him to follow me; but plainly he did not do so. 'You are our guide,' said Gimli, 'and you are skilled in the chase. You shall choose.'
'My heart bids me go on,' said Legolas. 'But we must hold together. I will follow your counsel.'
'You give the choice to an ill chooser,' said Aragorn. 'Since we passed through the Argonath my choices have gone amiss.' He fell silent gazing north and west into the gathering night for a long while. 'We will not walk in the dark,' he said at length. 'The peril of missing the trail or signs of other coming and going seems to me the greater. If the Moon gave enough light, we would use it, but alas! he sets early and is yet young and pale.'
'And tonight he is shrouded anyway,' Gimli murmured. 'Would that the Lady had given us a light, such a gift as she gave to Frodo!'
'It will be more needed where it is bestowed,' said Aragorn. 'With him lies the true Quest. Ours is but a small matter in the great deeds of this time. A vain pursuit from its beginning, maybe, which no choice of mine can mar or mend. Well, I have chosen. So let us use the time as best we may!'
He cast himself on the ground and fell at once into sleep, for he had not slept since their night under the shadow of Tol Brandir. Before dawn was in the sky he woke and rose. Gimli was still deep in slumber, but Legolas was standing, gazing northwards into the darkness, thoughtful and silent as a young tree in a windless night.
'They are far far away,' he said sadly, turning to Aragorn. 'I know in my heart that they have not rested this night. Only an eagle could overtake them now.' 'Nonetheless we will still follow as we may,' said Aragorn. Stooping he roused the Dwarf. 'Come! We must go,' he said. 'The scent is growing cold.' 'But it is still dark,' said Gimli. 'Even Legolas on a hill-top could not see them till the Sun is up.' 'I fear they have passed beyond my sight from hill or plain, under moon or sun,' said Legolas.
'Where sight fails the earth may bring us rumour,' said Aragorn. 'The land must groan under their hated feet.' He stretched himself upon the ground with his ear pressed against the turf. He lay there motionless, for so long a time that Gimli wondered if he had swooned or fallen asleep again. Dawn came glimmering, and slowly a grey light grew about them. At last he rose, and now his friends could see
his face: it was pale and drawn, and his look was troubled.
'The rumour of the earth is dim and confused,' he said. 'Nothing walks upon it for many miles about us. Faint and far are the feet of our enemies. But loud are the hoofs of the horses. It comes to my mind that I heard them, even as I lay on the ground in sleep, and they troubled my dreams: horses galloping, passing in the West. But now they are drawing ever further from us, riding northward. I wonder what is happening in this land!' 'Let us go!' said Legolas.
So the third day of their pursuit began. During all its long hours of cloud and fitful sun they hardly paused, now striding, now running, as if no weariness could quench the fire that burned them. They seldom spoke. Over the wide solitude they passed and their elven-cloaks faded against the background of the grey-green fields; even in the cool sunlight of mid-day few but elvish eyes would have marked them, until they were close at hand. Often in their hearts they thanked the Lady of L髍ien for the gift of _lembas_, for they could eat of it and find new strength even as they ran.
All day the track of their enemies led straight on, going north-west without a break or turn. As once again the day wore to its end they came to long treeless slopes, where the land rose, swelling up towards a line of low humpbacked downs ahead. The orc-trail grew fainter as it bent north towards them, for the ground became harder and the grass shorter. Far away to the left the river Entwash wound, a silver thread in a green floor. No moving thing could be seen. Often Aragorn wondered that they saw no sign of beast or man. The dwellings of the Rohirrim were for the most part many leagues away to the South, under the wooded eaves of the White Mountains, now hidden in mist and cloud; yet the Horse-lords had formerly kept many herds and studs in the Eastemnet, this easterly region of their realm, and there the herdsmen had wandered much, living in camp and tent, even in winter-time. But now all the land was empty, and there was silence that did not seem to be the quiet of peace.
At dusk they halted again. Now twice twelve leagues they had passed over the plains of Rohan and the wall of the Emyn Muil was lost in the shadows of the East. The young moon was glimmering in a misty sky, but it gave small light, and the stars were veiled.
'Now do I most grudge a time of rest or any halt in our chase ' said Legolas. 'The Orcs have run before us, as if the very whips of Sauron were behind them. I fear they have already reached the forest and the dark hills, and even now are passing into the shadows of the trees.'
Gimli ground his teeth. 'This is a bitter end to our hope and to all our toil!' he said.
'To hope, maybe, but not to toil,' said Aragorn. 'We shall not turn back here. Yet I am weary.' He gazed back along the way that they had come towards the night gathering in the East. 'There is something strange at work in this land. I distrust the silence. I distrust even the pale Moon. The stars are faint; and I am weary as I have seldom been before, weary as no Ranger should be with a clear trail to follow. There is some will that lends speed to our foes and sets an unseen barrier before us: a weariness that is in the heart more than in the limb.'
'Truly!' said Legolas. 'That I have known since first we came down from the Emyn Muil. For the will is not behind us but before us.' He pointed away over the land of Rohan into the darkling West under the sickle moon. 'Saruman!' muttered Aragorn. 'But he shall not turn us back! Halt we must once more; for, see! even the Moon is falling into gathering cloud. But north lies our road between down and fen when day returns.'
As before Legolas was first afoot, if indeed he had ever slept. 'Awake! Awake!' he cried. 'It is a red dawn. Strange things await us by the eaves of the forest. Good or evil, I do not know; but we are called. Awake!'
The others sprang up, and almost at once they set off again. Slowly the downs drew near. It was still an hour before noon when they reached them: green slopes rising to bare ridges that ran in a line straight towards the North. At their feet the ground was dry and the turf short, but a long strip of sunken land, some ten miles wide, lay between them and the river wandering deep in dim thickets of reed and rush. Just to the West of the southernmost slope there was a great ring, where the turf had been torn and beaten by many trampling feet. From it the orc-trail ran out again, turning north along the dry skirts of the hills. Aragorn halted and examined the tracks closely.
'They rested here a while,' he said, 'but even the outward trail is already old. I fear that your heart spoke truly, Legolas: it is thrice twelve hours, I guess, since the Orcs stood where we now stand. If they held to their pace, then at sundown yesterday they would reach the borders of Fangorn.'
'I can see nothing away north or west but grass dwindling into mist,' said Gimli. 'Could we see the forest, if we climbed the hills?'
'It is still far away,' said Aragorn. 'If I remember rightly, these downs run eight leagues or more to the north, and then north-west to the issuing of the Entwash there lies still a wide land. another fifteen leagues it may be.'
'Well, let us go on,' said Gimli. 'My legs must forget the miles. They would be more willing, if my heart were less heavy.'
The sun was sinking when at last they drew near to the end of the line of downs. For many hours they had marched without rest. They were going slowly now, and Gimli's back was bent. Stone-hard are the Dwarves in labour or journey, but this endless chase began to tell on him, as all hope failed in his heart. Aragorn walked behind him, grim and silent, stooping now and again to scan some print or mark upon the ground. Only Legolas still stepped as lightly as ever, his feet hardly seeming to press the grass. leaving no footprints as he passed; but in the waybread of the Elves he found all the sustenance that he needed, and he could sleep, if sleep it could be called by Men, resting his mind in the strange paths of elvish dreams, even as he walked open-eyed in the light of this world.
'Let us go up on to this green hill!' he said. Wearily they followed him, climbing the long slope, until they came out upon the top. It was a round hill smooth and bare, standing by itself, the most northerly of the downs. The sun sank and the shadows of evening fell like a curtain. They were alone in a grey formless world without mark or measure. Only far away north-west there was a deeper darkness against the dying light: the Mountains of Mist and the forest at their feet.
'Nothing can we see to guide us here,' said Gimli. 'Well, now we must halt again and wear the night away. It is growing cold!'
'The wind is north from the snows,' said Aragorn.
'And ere morning it will be in the East,' said Legolas. 'But rest if you must. Yet do not cast all hope away. Tomorrow is unknown. Rede oft is found at the rising of the Sun.' 'Three suns already have risen on our chase and brought no counsel ' said Gimli.
The night grew ever colder. Aragorn and Gimli slept fitfully, and whenever they awoke they saw Legolas standing beside them, or walking to and fro, singing softly to himself in his own tongue, and as he sang the white stars opened in the hard black vault above. So the night passed. Together they watched the dawn grow slowly in the sky, now bare and cloudless, until at last the sunrise came. It was pale and clear. The wind was in the East and all the mists had rolled away; wide lands lay bleak about them in the bitter light.
Ahead and eastward they saw the windy uplands of the Wold of Rohan that they had already glimpsed many days ago from the Great River. North-westward stalked the dark forest of Fangorn; still ten leagues away stood its shadowy eaves, and its further slopes faded into the distant blue. Beyond there glimmered far away, as if floating on a grey cloud, the white head of tall Methedras, the last peak of the Misty Mountains. Out of the forest the Entwash flowed to meet them, its stream now swift and narrow, and its banks deep-cloven. The orc-trail turned from the downs towards it.
Following with his keen eyes the trail to the river, and then the river back towards the forest, Aragorn saw a shadow on the distant green, a dark swift-moving blur. He cast himself upon the ground and listened again intently. But Legolas stood beside him, shading his bright elven-eyes with his long slender hand, and he saw not a shadow, nor a blur, but the small figures of horsemen, many horsemen, and the glint of morning on the tips of their spears was like the twinkle of minute stars beyond the edge of mortal sight. Far behind them a dark smoke rose in thin curling threads. There was a silence in the empty fields, arid Gimli could hear the air moving in the grass. 'Riders!' cried Aragorn, springing to his feet. 'Many riders on swift steeds are coming towards us!'
'Yes,' said Legolas, 'there are one hundred and five. Yellow is their hair, and bright are their spears. Their leader is very tall.' Aragorn smiled. 'Keen are the eyes of the Elves,' he said.
因篇幅问题不能全部显示,请点此查看更多更全内容
Copyright © 2019- huatuo7.cn 版权所有 湘ICP备2022005869号-9
违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com
本站由北京市万商天勤律师事务所王兴未律师提供法律服务