首页 学生评语生成系统的开发—计算机毕业设计(论文)

学生评语生成系统的开发—计算机毕业设计(论文)

举报
开通vip

学生评语生成系统的开发—计算机毕业设计(论文)学生评语生成系统的开发—计算机毕业设计(论文) 学生评语生成系统的开发 前 言 电脑已经成为挂在我们嘴角的一句口头禅,它已经深入到日常工作和生活的方方面面,比如文字处理、信息管理、辅助设计、图形图像处理、教育培训以及游戏娱乐等。Windows系统的推出使电脑从高雅的学术殿堂走入了寻常百姓家,各行各业的人们无须经过特别的训练就能够使用电脑完成许许多多复杂的工作。然而,虽然现在世界上已经充满了多如牛毛的各种软件,但它们依然不能满足用户的各种特殊需要,人们还不得不开发适合自己特殊需求的软件。以前开发Windows下...

学生评语生成系统的开发—计算机毕业设计(论文)
学生评语生成系统的开发—计算机毕业 设计 领导形象设计圆作业设计ao工艺污水处理厂设计附属工程施工组织设计清扫机器人结构设计 ( 论文 政研论文下载论文大学下载论文大学下载关于长拳的论文浙大论文封面下载 ) 学生评语生成系统的开发 前 言 电脑已经成为挂在我们嘴角的一句口头禅,它已经深入到日常工作和生活的方方面面,比如文字处理、信息管理、辅助设计、图形图像处理、教育培训以及游戏娱乐等。Windows系统的推出使电脑从高雅的学术殿堂走入了寻常百姓家,各行各业的人们无须经过特别的训练就能够使用电脑完成许许多多复杂的工作。然而,虽然现在世界上已经充满了多如牛毛的各种软件,但它们依然不能满足用户的各种特殊需要,人们还不得不开发适合自己特殊需求的软件。以前开发Windows下软件是专业人员的工作,需要掌握许多专业知识和经过特殊的培训才能胜任。现在不同了,即使你没有接受过严格的程序设计训练,使用Visual Basic也一样能够开发出功能强大、适合自己特殊需求的应用程序了。Visual Basic继承了Basic语言易学易用的特点,特别适合于初学者学习Windows系统编程。 我作为一名××××大学的学生,对从事计算机操作和编程工作有着特殊的爱好,在工作和学习之余,我时常钻研专业课基础理论,经常用VB调试一些小程序。有一天,我的一位做中学教师的朋友找上门来,说,快要放假了,写80多个学生的评语实在是件麻烦事,能不能做个评语生成器什么的,一定要帮忙哟。为了友情,更是为了向××××大学交一份满意的答卷,我于是着手设计开始一个评语生成系统。通过这两年多来我在××××大学计算机专业的学习,我初步掌握了VB语言的最基本的知识,于是在××××大学的老师指导下动手用VB编写本学生评语生成系统。 第一章 VB语言概述 1.1、VB简介 VB是微软公司出品的一个快速可视化程序开发工具软件,借助微软在操作系统和办公软件的垄断地位,VB在短短的几年内风靡全球。VB是极有和功能强大的软件,主要表现在:所见即所得的界面设计,基于对象的设计方法,极短的软件开发周期,较易维护的生成代码。 美国微软公司在1991年推出VB1.0至今已经经历了6个版本,VB6.0运行在win9x或winme,win2000,winxp,windowsNT等操作系统下,是一个32位的应用程序开发工具。 1.2、VB语言的基本特点及VB应用程序的基本持点 VB程序语言具有许多优秀的特性,用其设计应用程序时有两个基本特点:可视化设计和事件驱动编程. 1、可视化设计 同其他的一些可视化程序开发工具一样,VB具有可视化设计的特点,微软的Word在刚刚进入市场时,同WPS竞争的一个重要的功能砝码就是"所见即所得"的字处理功能,VB在设计应用程序界面时也可以说是"所见即所得".在设计时,头脑中所想象的应用程序界面,完全可以通过键盘鼠标以及徒手画出来,而不是编制大量的代码然后再编译生成,如果需要修改,也是利用键盘鼠标和手画,而底层的一些程序代码由VB自动生成或修改。 VB为用户提供大量的界面元素(在VB中称为控件对象),这些控件对象对于熟悉Windows应用程序的用户而言是一点也不陌生,如"窗体"、"菜单"、"命令按钮"、"工具按钮"、"检查框"等等,用户只需要利用鼠标、键盘把这些控件对象拖动到适当的位置,设置它们的大小、形状、属性等,就可以设计出所需的应用程序界面。 2、事件驱动编程 图形化的用户界面和多任务多进程的应用程序要求程序设 Windows操作系统出现以来, 计不能是单一性的,在使用VB设计应用程序时,必须首先确定应用程序如何同用户进行交互.例如发生鼠标单击、键盘输入等事件时,由用户编写的代码控制这些事件的响应,这就是所谓的事件驱动编程。 在VB中把窗体以及"菜单"、"按钮"等控件称为对象,如果设计出了应用 前面已经谈到, 程序,那么与应用程序的用户直接进行交互的就是这些对象组成的图形界面,也称为用户接口或用户界面,在设计应用程序时就必须考虑到用户如何与程序进行交户.更进一步,甚至程序和程序之间也会有通讯和交户,基本上用户是通过鼠标、键盘与应用程序进行交互的,这时那些对象就必须对鼠标和键盘操作所引发的事件做出响应.响应就是指执行一段应用程序,它不沿预定的路径执行,而是在响应不同事件时执行不同的代码.因此,应用程序代码的路径在每次响应而执行时可能都是不形同的。 1.3、为何选择VB作为开发语言 除了VB之外,当前能够编制Windows应用程序的可视化编程工具还有很多,所针对的编程领域也各有侧重,就微软系列的可视化开发工具而言,就有VB,VisualC++,VisualJ++,Visual Foxpro等,其中Visual Foxpro是针对数据库编程的开发工具;Visual C++是为专业程序设计员提供的开发工具,变量声明和定义严密,功能强大灵活,必须经过相当的努力才能掌握;而VB不支持虚类、多态性和类的继承,相对而言VB简单易学,变量定义不太严密,对于非专业程序员而言功能足够强大,同Visual C++一样也支持网络编程和数据库编程。 除了微软之外,其他公司也在为Windows操作系统平台制作应用程序开发工具,例如前Borland的公司出品的Delphi,C++Bulider, J++Bulider等,其他一些公司出品的针对数据库编程的PowerBulider, PowerDesigner等,不可否认,这些产品相当出色,如果能够熟练掌握将是编程者能力的体现,但是必须承认,对Windows操作系统最熟悉的还是微软,而且微软本身Windows操作系统的源代码采取不公开的策略,使得其他公司出品的产品在实现相同功能时多少都要走些弯路,用户在使用这些 产品设计 产品设计简历产品设计简历产品设计简历产品设计简历产品设计简历 应用程序时,程序的效率将会受到影响。 在选择所需要的应用程序开发工具时,不但要考虑开发工具的功能是否强大,还要考虑所花费的时间和效果,单纯地追求功能的强大,也许会事倍功半。 中央电大陈明主编的《Visual Basic程序设计》是计算机应用专业采用的一本难得的教材,使我受益匪浅。通过这门课程的学习,我已能用VB编写简单的程序,为了搞好这次毕业设计,我决定使用VB作为编程语言。 1.4、VB6.0应用的基本开发方法 1、交互式开发 传统的应用程序开发过程可以分为三个明显的步骤:编码、编译和测试。但是VB与传统的语言不同,它使用交互式方法开发应用程序,使三个步骤之间不再有明显的界限。 在大多数语言里,如果编写代码时发生了错误,则在开始编译应用程序时该错误就会被编译器捕获。此时必须查找并改正该错误,然后再次进行编译,对每一个发现的错误都要重复这样的过程。VB在编程者输入代码时便进行解释,即时捕获并突出显示大多数语法或拼写错误。看起来就像一位专家在监视代码的输入。 除即时捕获错误以外,VB也在输入代码时部分地编译该代码。当准备运行和测试应用程序时,只需极短时间即可完成编译。如果编译器发现了错误、则将错误突出显示于代码中。这时可以更正错误并继续编译、而不需从头开始。 交互特性,因此在开发应用程序时,系统频繁地运行着应用程序。通过这种方 由于VB的 式,代码运行的效果可以在开发时进行测试,而不必等到编译完成以后。 2、事件驱动应用程序的工作方式 事件是窗体或控件对象识别的动作。在响应事件时,事件驱动应用程序执行VB代码。VB的每一个窗体和控件对象都有一个预定义的事件集。如果其中有一个事件发生,并且在关联的事件过程中存在代码,则VB就会调用该代码。 尽管VB中的对象自动识别预定义的事件集,但要判定它们是否响应具体事件以及如何响应具体事件则是编程的工作了。代码部分(即事件过程)与每个事件对应。如果让控件对象响应事件,就把代码写入这个事件过程之中。 对象所识别的事件类型多种多样,但多数事件类型是大多数控件所共有的。例如,大多数对象都能识别click事件,如果单击窗体,则执行窗体的单击事件过程中的代码;如果单击命令按钮,则执行命令按钮的click事件过程中的代码。每种情况中的实际代码几乎完全不一样。 以下是事件驱动应用程序中的典型事件序列: ?启动应用程序,装载和显示窗体。 ?窗体(或窗体上的控件)接收事件。事件可由用户引发(例如键盘操作或数鼠标点击)、可由系统引发(例如定时器事件),也可由代码间接引发(例如当代码装载窗体时的load事件)。 ?如果在相应的事件过程中存在代码,就执行代码。 ?应用程序等待下一次事件。许多事件伴随其它事件发生。例如,在Dblclick事件发生时,MouseDown,Mouseup和click事件也会发生。 创建VB应用程序的三个步骤 3、 ?创建应用程序界面 ?设置属性 ?编写代码 4、VB的程序设计是面向对象的可视化程序设计。其方法是在窗体上放置可视化的对象然后对它们设置属性、触发事件和执行方法进行程序设计。对象放置完毕后用户所见到的只是一个空壳,就像一台没有装任何软件的计算机,必须给它赋予程序,才能完成一定的功 能。 VB程序贮存在模块中,模块分有窗体、类和 标准 excel标准偏差excel标准偏差函数exl标准差函数国标检验抽样标准表免费下载红头文件格式标准下载 模块三种类型。每个模块包含有声明和过程。窗体模块包含处理事件过程、通用过程及变量、常数等窗体级说明;标准模块应用程序内其他模块访问的过程和声明的容器;类模块中包含了建立新对象的程序。 5、窗体与基本输入、输出 在进行VB程序设计中,设计者并不需要自己编制VB程序代码来生成图形界面。VB提供了大量现成的图形控件和其他一些控件,例如所熟悉的菜单、命令按钮、对话框等,供给用户“堆砌”起来构造自己想象中的图形界面,因此几乎不用书写什么程序代码,“画”上几笔就可完成程序员的构思,获得应用程序的图形界面。 VB应用程序图形界面的设计首先要从窗体开始,其他的一些控件基本上归属于窗体控件(很多是直接“画”在窗体上的),通常应把窗体定义成一个构成应用程序可见部分的窗口,而一个VB的应用程序应首先从设计窗体开始。 VB应用程序设计过程中重要考虑的问 快递公司问题件快递公司问题件货款处理关于圆的周长面积重点题型关于解方程组的题及答案关于南海问题 是应用程序与用户的交互,而窗体可以实现将输出信息提供给用户。 6、常用控件:在窗体上用于输入、输出信息的图形或文字符号称为控件。为了方便用户开发应用程序,VB中提供了很多的控件,其中很多控件是windows本身的资源,如命令按钮、标签、文本框等,也有一些是为了增强用户界面,或是使用户界面美观实用而编制的ActiveX控件。 1.5、VB与API函数:VB无疑是最先进的编程工具之一,但在涉及windows 32位系统的核心编程方面,譬如一些高级功能的实现上,它仍然显得有些力不从心,这需要我们充分利用vb的强大的Windows API函数调用能力来弥补。作为一个编程初学者来说,API函数也许是一个时常耳闻却感觉有些神秘的东西。单看它的复杂语法,就足令人望而生畏,但是任何事物在我们深入了解它之前,总是会有这种感觉的。其实我们应该把API函数的来龙去脉搞清楚,破除对API函数的畏惧,使它成为我们编程的好助手。 大家可能在许多书上看到过API的英文全称(Application Programming Interface),WIN32 API也就是MicrosoftWindows 32位平台的应用程序编程接口。对这个定义的理解,需要追溯到操作系统的发展历史上,当WINDOWS操作系统开始占据主导地位的时候,开发WINDOWS平台下的应用程序成为人们的需要。而在WINDOWS程序设计领域处于发展的初期,WINDOWS程序员所能使用的编程工具唯有API函数,这些函数是WINDOWS提供给应用程序与操作系统的接口,他们犹如“积木块”一样,可以搭建出各种界面丰富,功能灵活的应用程序。所以可以认为API函数是构筑整个WINDOWS框架的基石,在它的下面是WINDOWS的操作系统核心,而它的上面则是所有的华丽的WINDOWS应用程序。(配图1) Windows应用程序 Win32Api函数(应用程序接口) Windows操作系统底层 图1 但是,那时的WINDOWS程序开发还是比较复杂的工作,程序员必须熟记一大堆常用的API函数,而且还得对WINDOWS操作系统有深入的了解。然而随着软件技术的不断发展,在WINDOWS平台上出现了很多优秀的可视化编程环境,程序员可以采用“即见即所得”的编程方式来开发具有精美用户界面和功能强大的应用程序。 这些优秀可视化编程环境操作简单、界面友好(诸如VB、VC++、DELPHI等),在这些 工具中提供了大量的类库和各种控件,它们替代了API的神秘功能,事实上这些类库和控件都是构架在WIN32 API函数基础之上的,是封装了的API函数的集合。它们把常用的API函数的组合在一起成为一个控件或类库,并赋予其方便的使用方法,所以极大的加速了WINDOWS应用程序开发的过程。有了这些控件和类库,程序员便可以把主要精力放在程序整体功能的设计上,而不必过于关注技术细节。 实际上如果我们要开发出更灵活、更实用、更具效率的应用程序,必然要涉及到直接使用API函数,虽然类库和控件使应用程序的开发简单的多,但它们只提供WINDOWS的一般功能,对于比较复杂和特殊的功能来说,使用类库和控件是非常难以实现的,这时就需要采用API函数来实现。 这也是API函数使用的场合,所以我们对待API函数不必刻来研究每一个函数的用法,那也是不现实的(能用的到的API函数有几千个呢)。正如某位人士所说:API不要去学,在需要的时候去查API帮助就足够了。 在VB中声明API函数有两种方法:如果我们只在某个窗体中使用API函数,我们可以在窗体代码的General部分声明它: 声明的语法是: Private Declare Function ... Private Declare Sub..... 这里必须采用Private声明,因为这个API函数只能被一个窗体内的程序所调用。 如果我们的程序有多个窗体构成,而且我们需要在多个窗体中使用同一个API函数,就需要在模块中声明了。 先添加一个模块,具体方法为:在设计程序时,选“project”菜单项下的子菜单项“Add Moudle” 然后采用如下语法声明: Public Declare Function.... Public Declare Sub.... Public声明的含义是把API函数作为一个公共函数或过程,在一个工程中的任何位置(包括所有的窗体和模块)都能直接调用它。 声明完毕我们就能在程序中使用此API函数了。 可采用以下几种方式使用API函数,以SetWindowPos函数为例: (1)忽略函数返回值的调用: SetWindowPos Form1.hWnd, -2 ,0 ,0 ,0, 0, 3 注意此时函数的参数是不加括号的。 (2)Call方法调用: Call SetWindowPos(Form1.hWnd, -2, 0, 0, 0, 3) 注意这里需要加上括号,但我们不取回函数的返回值。 (3)取得函数返回值的调用: MyLng = SetWindowPos(Form1.hWnd, -2, 0, 0, 0,3) 此时需要加上括号,而且我们必须事先定义一个变量(变量的类型与函数返回值类型相同)来存储API函数的返回值。 几个问题的说明: (1)声明中的Lib 和 Alias 是怎么回事 一般情况下WIN32API函数总是包含在WINDOWS系统自带的或是其它公司提供的动态连接库DLL中,而Declare语句中的Lib关键字就用来指定DLL(动态连接库)文件的路径,这样VB才能找到这个DLL文件,然后才能使用其中的API函数。如果我们只是列出DLL文件名而不指出其完整的路径的话,VB会自动到.EXE文件所在目录、当前工作目录、WINDOWS\SYSTEM目录、WINDOWS目录下搜寻这个DLL文件。所以如果所要使用DLL文件不在上述几个目录下的话,我们应该指明其完整路径。 Alias用于指定API函数的别名,如果我们调用的API函数要使用字符串(参数中包含String型)的话,Alias关键字是必须的。这是因为在ANSI和Unicode字符集中同一API函数的名称可能是不一样的,为了保证不出现声明错误,我们使用Alias关键字指出API函数的别名,一般来说在WIN9X平台下我们把API函数名后加一个大写A作为别名即可。 (2)常见的API参数类型的说明 API函数的参数中最常见的是长整Long型数据类型,例如API中的句柄、一些特定的常量、函数的返回值都是此类型 的值;另外几种常见的参数类型有:整型Integer、Byte型、String型等。 (3)声明中的ByVal是作什么用的 这跟VB的参数传递方式有关,在默认情况下VB是通过地址传递方式传递函数的参数、而有些API函数要求必须采用传值方式来传递函数参数(这两种参数传递方式是不同的,前者传递的是一个指针,而后者要求是参数真实的值)。这样就会发生错误,解决的办法是在API函数参数声明的前面加上ByVal关键字,这样VB就采用传值方式传递参数了。 (4)怎样得到完整的API函数声明 VB自带了API文本查看器API TEXT VIEWER,我们可以在其中找到API函数的完整声明,然后把它粘贴到程序中即可。 了解了以上有关VB的基础知识,我们现在就可以开始着手运用VB进行程序设计了。 第二章 学生评语生成系统的开发 2(1、本软件将具有何种功能 1、能根据对某位学生的“德、智、体、美、劳”表现(即优秀、良好、一般、差)进行简单的选择,便能自动生成相应的评语。 2、可选择相应的寄语,以及加入个人的评语。 3、对生成的评语可以进行修改。 4、最后生成一个文本文件(.txt),使我们可方便地导入到wps或word中进行排版打印。 2(2、有关界面及控件设置 一、界面及控件设置如下图所示: 二、有关控件的属性 控件名称 属性 功能描述 Combo1 Text=’请选择寄语’ 供选择相应的寄语 Command1 Caption=”生成” Command2 Caption=”保存” 保存成.txt文件 Command3 Caption=“退出” Text1 供生成评语 Text2 供添加自定义评语 Text3 供输入姓名 Frame控件4个 分开德智体美劳五项 Option控件20个 细分成四个等级 Label控件3个 显示相应提示信息 2(3、源代码 Option Explicit '声明德智体美劳变量 Dim Mind As String, Score As String, PE As String Dim Manner As String, Labor As String, jy As String Private Sub Combo1_Click() jy = Combo1.Text End Sub '生成 Private Sub Command1_Click() If Text3.Text = "" Then MsgBox "姓名栏不能为空", vbOKOnly, "提示" Text3.SetFocus Text1.Text = "" Else Text1 = " " + Text3.Text + "同学一学期来" + Mind + Score + _ PE + Manner + Labor + Text2.Text + jy End If End Sub '保存 Private Sub Command2_Click() Dim sF As String sF = Text3.Text + ".txt" Open sF For Output As #1 Print #1, Text1.Text Close #1 End Sub Private Sub Command3_Click() End '退出 End Sub '德 Private Sub Option1_Click(Index As Integer) Select Case Index Case 0 Mind = "各方面从高从严要求自己,上进心强,遵守纪律。" Case 1 Mind = "思想上要求进步,严于律已,能较好地遵守校纪班规。" Case 2 Mind = "有一定的上进心,基本上能遵守学校的规章制度。" Case 3 Mind = "思想纪律表现一般,基本上能遵守校纪班规,但自律能力不强, 偶尔" + "有意外行为。" End Select End Sub '智 Private Sub optScore_Click(Index As Integer) Select Case Index Case 0 Score = "学习能力出众,勤奋用功,成绩优异,如保持下去,前途无限。" Case 1 Score = "学习能力较好,肯下功夫,成绩优良,有较好的发展潜力。" Case 2 Score = "有一定的自学能力,所作出的努力取得相应的成绩,挖掘潜力可观。" Case 3 Score = "学习上用心程度不够,成绩不太理想,但悟性较好,经努力会很快有 长足进步的。" End Select End Sub '体 Private Sub Option3_Click(Index As Integer) Select Case Index Case 0 PE = "热爱体育,积极参加体育锻炼,体能素质优良,身体健康。" Case 1 PE = "爱好体育,主动参加体育锻炼,体能素质良好,身体健康。" Case 2 PE = "基本上按要求参加体育锻炼,成绩合格。" Case 3 PE = "体育方面不太理想,身体素质有待加强。" End Select End Sub '美 Private Sub Option4_Click(Index As Integer) Select Case Index Case 0 Manner = "为人诚实,尊重老师、长辈,团结同学,乐于助人。" Case 1 Manner = "待人有礼貌,尊重师长、团结同学。" Case 2 Manner = "和气待人,与同学和好相处。" Case 3 Manner = "举止有进欠周到,望加强修养。" End Select End Sub '劳 Private Sub Option2_Click(Index As Integer) Select Case Index Case 0 Labor = "热爱劳动,有吃苦耐劳的精神。" Case 1 Labor = "劳动积极肯干,能吃苦耐劳。" Case 2 Labor = "劳动课能完成任务,但主动性有待提高。" Case 3 Labor = "劳动方面认识不足,表现一般。" End Select End Sub 第三章 毕业设计总结 历时一个多月的毕业设计终于快到了尾声,通过这次毕业设计,在老师的指导下,我初步掌握了用VB开发软件的方法,我在进行设计软件时遇到了一些困难,于是我在老师的提示和鼓励下,查资料,上网和网友进行探讨。我在程序员之家,网址为上的论坛和高手进行交流,对我受益菲浅。此外我还登录到天极网站看了不少优秀的vb技术文章。这些对我搞好毕业设计起了至关重要的作用。在此再次感谢××××大学的指导老师对我的悉心指导与帮助。由于时间仓促,这个软件肯定还有不完善的地方,比如评语的内容还不太丰富。这有待我以后继续完善,肯请各位老师提出批评改进意见。 第四章 程序运行软硬件环境 1、软件环境:操作系统是windowsxp专业版,在VisualBasic6.0编程环境下编译。 2、硬件环境:p4赛扬2.4G,DDR256M内存,60G硬盘空间。 第五章 主要参考文献 1、《Visual Basic 程序设计》清华大学出版 2002年7月第1版 李大友主编 2、《Visual Basic开发人员指南》机械工业出版社 1999年1月 EricBrierley主编 3、《Visual Basic 程序设计》中央电大出版 2000年12月第1版 陈明 主编 4、《Visual Basic6.0实效编程百例》人民邮电出版社 2002年7月 刘韬、骆娟主编 5、《数据结构(c++描述)》 中央电大出版 2000年12月第1版 徐孝凯主编 学生评语生成系统的开发 前 言 电脑已经成为挂在我们嘴角的一句口头禅,它已经深入到日常工作和生活的方方面面,比如文字处理、信息管理、辅助设计、图形图像处理、教育培训以及游戏娱乐等。Windows系统的推出使电脑从高雅的学术殿堂走入了寻常百姓家,各行各业的人们无须经过特别的训练就能够使用电脑完成许许多多复杂的工作。然而,虽然现在世界上已经充满了多如牛毛的各种软件,但它们依然不能满足用户的各种特殊需要,人们还不得不开发适合自己特殊需求的软件。以前开发Windows下软件是专业人员的工作,需要掌握许多专业知识和经过特殊的培训才能胜任。现在不同了,即使你没有接受过严格的程序设计训练,使用Visual Basic也一样能够开发出功能强大、适合自己特殊需求的应用程序了。Visual Basic继承了Basic语言易学易用的特点,特别适合于初学者学习Windows系统编程。 我作为一名××××大学的学生,对从事计算机操作和编程工作有着特殊的爱好,在工作和学习之余,我时常钻研专业课基础理论,经常用VB调试一些小程序。有一天,我的一位做中学教师的朋友找上门来,说,快要放假了,写80多个学生的评语实在是件麻烦事,能不能做个评语生成器什么的,一定要帮忙哟。为了友情,更是为了向××××大学交一份满意的答卷,我于是着手设计开始一个评语生成系统。通过这两年多来我在××××大学计算机专业的学习,我初步掌握了VB语言的最基本的知识,于是在××××大学的老师指导下动手用VB编写本学生评语生成系统。 第三章 VB语言概述 1.1、VB简介 VB是微软公司出品的一个快速可视化程序开发工具软件,借助微软在操作系统和办公软件的垄断地位,VB在短短的几年内风靡全球。VB是极有和功能强大的软件,主要表现在:所见即所得的界面设计,基于对象的设计方法,极短的软件开发周期,较易维护的生成代码。 美国微软公司在1991年推出VB1.0至今已经经历了6个版本,VB6.0运行在win9x或winme,win2000,winxp,windowsNT等操作系统下,是一个32位的应用程序开发工具。 1.2、VB语言的基本特点及VB应用程序的基本持点 VB程序语言具有许多优秀的特性,用其设计应用程序时有两个基本特点:可视化设计和事件驱动编程. 1、可视化设计 同其他的一些可视化程序开发工具一样,VB具有可视化设计的特点,微软的Word在刚刚进入市场时,同WPS竞争的一个重要的功能砝码就是"所见即所得"的字处理功能,VB在设计应用程序界面时也可以说是"所见即所得".在设计时,头脑中所想象的应用程序界面,完全可以通过键盘鼠标以及徒手画出来,而不是编制大量的代码然后再编译生成,如果需要修改,也是利用键盘鼠标和手画,而底层的一些程序代码由VB自动生成或修改。 VB为用户提供大量的界面元素(在VB中称为控件对象),这些控件对象对于熟悉Windows应用程序的用户而言是一点也不陌生,如"窗体"、"菜单"、"命令按钮"、"工具按钮"、"检查框"等等,用户只需要利用鼠标、键盘把这些控件对象拖动到适当的位置,设置它们的大小、形状、属性等,就可以设计出所需的应用程序界面。 2、事件驱动编程 图形化的用户界面和多任务多进程的应用程序要求程序设 Windows操作系统出现以来, 计不能是单一性的,在使用VB设计应用程序时,必须首先确定应用程序如何同用户进行交互.例如发生鼠标单击、键盘输入等事件时,由用户编写的代码控制这些事件的响应,这就是所谓的事件驱动编程。 在VB中把窗体以及"菜单"、"按钮"等控件称为对象,如果设计出了应用 前面已经谈到, 程序,那么与应用程序的用户直接进行交互的就是这些对象组成的图形界面,也称为用户接口或用户界面,在设计应用程序时就必须考虑到用户如何与程序进行交户.更进一步,甚至程序和程序之间也会有通讯和交户,基本上用户是通过鼠标、键盘与应用程序进行交互的,这时那些对象就必须对鼠标和键盘操作所引发的事件做出响应.响应就是指执行一段应用程序,它不沿预定的路径执行,而是在响应不同事件时执行不同的代码.因此,应用程序代码的路径在每次响应而执行时可能都是不形同的。 1.3、为何选择VB作为开发语言 除了VB之外,当前能够编制Windows应用程序的可视化编程工具还有很多,所针对的编程领域也各有侧重,就微软系列的可视化开发工具而言,就有VB,VisualC++,VisualJ++,Visual Foxpro等,其中Visual Foxpro是针对数据库编程的开发工具;Visual C++是为专业程序设计员提供的开发工具,变量声明和定义严密,功能强大灵活,必须经过相当的努力才能掌握;而VB不支持虚类、多态性和类的继承,相对而言VB简单易学,变量定义不太严密,对于非专业程序员而言功能足够强大,同Visual C++一样也支持网络编程和数据库编程。 除了微软之外,其他公司也在为Windows操作系统平台制作应用程序开发工具,例如前Borland的公司出品的Delphi,C++Bulider, J++Bulider等,其他一些公司出品的针对数据库编程的PowerBulider, PowerDesigner等,不可否认,这些产品相当出色,如果能够熟练掌握将是编程者能力的体现,但是必须承认,对Windows操作系统最熟悉的还是微软,而且微软本身Windows操作系统的源代码采取不公开的策略,使得其他公司出品的产品在实现相同功能时多少都要走些弯路,用户在使用这些产品设计应用程序时,程序的效率将会受到影响。 在选择所需要的应用程序开发工具时,不但要考虑开发工具的功能是否强大,还要考虑所花费的时间和效果,单纯地追求功能的强大,也许会事倍功半。 中央电大陈明主编的《Visual Basic程序设计》是计算机应用专业采用的一本难得的教材,使我受益匪浅。通过这门课程的学习,我已能用VB编写简单的程序,为了搞好这次毕业设计,我决定使用VB作为编程语言。 1.4、VB6.0应用的基本开发方法 1、交互式开发 传统的应用程序开发过程可以分为三个明显的步骤:编码、编译和测试。但是VB与传统的语言不同,它使用交互式方法开发应用程序,使三个步骤之间不再有明显的界限。 在大多数语言里,如果编写代码时发生了错误,则在开始编译应用程序时该错误就会被编译器捕获。此时必须查找并改正该错误,然后再次进行编译,对每一个发现的错误都要重复这样的过程。VB在编程者输入代码时便进行解释,即时捕获并突出显示大多数语法或拼写错误。看起来就像一位专家在监视代码的输入。 除即时捕获错误以外,VB也在输入代码时部分地编译该代码。当准备运行和测试应用程序时,只需极短时间即可完成编译。如果编译器发现了错误、则将错误突出显示于代码中。这时可以更正错误并继续编译、而不需从头开始。 交互特性,因此在开发应用程序时,系统频繁地运行着应用程序。通过这种方 由于VB的 式,代码运行的效果可以在开发时进行测试,而不必等到编译完成以后。 2、事件驱动应用程序的工作方式 事件是窗体或控件对象识别的动作。在响应事件时,事件驱动应用程序执行VB代码。VB的每一个窗体和控件对象都有一个预定义的事件集。如果其中有一个事件发生,并且在关联的事件过程中存在代码,则VB就会调用该代码。 尽管VB中的对象自动识别预定义的事件集,但要判定它们是否响应具体事件以及如何响应具体事件则是编程的工作了。代码部分(即事件过程)与每个事件对应。如果让控件对象响应事件,就把代码写入这个事件过程之中。 对象所识别的事件类型多种多样,但多数事件类型是大多数控件所共有的。例如,大多数对象都能识别click事件,如果单击窗体,则执行窗体的单击事件过程中的代码;如果单击命令按钮,则执行命令按钮的click事件过程中的代码。每种情况中的实际代码几乎完全不一样。 以下是事件驱动应用程序中的典型事件序列: ?启动应用程序,装载和显示窗体。 ?窗体(或窗体上的控件)接收事件。事件可由用户引发(例如键盘操作或数鼠标点击)、可由系统引发(例如定时器事件),也可由代码间接引发(例如当代码装载窗体时的load事件)。 ?如果在相应的事件过程中存在代码,就执行代码。 ?应用程序等待下一次事件。许多事件伴随其它事件发生。例如,在Dblclick事件发生时,MouseDown,Mouseup和click事件也会发生。 创建VB应用程序的三个步骤 3、 ?创建应用程序界面 ?设置属性 ?编写代码 4、VB的程序设计是面向对象的可视化程序设计。其方法是在窗体上放置可视化的对象然后对它们设置属性、触发事件和执行方法进行程序设计。对象放置完毕后用户所见到的只是一个空壳,就像一台没有装任何软件的计算机,必须给它赋予程序,才能完成一定的功 能。 VB程序贮存在模块中,模块分有窗体、类和标准模块三种类型。每个模块包含有声明和过程。窗体模块包含处理事件过程、通用过程及变量、常数等窗体级说明;标准模块应用程序内其他模块访问的过程和声明的容器;类模块中包含了建立新对象的程序。 5、窗体与基本输入、输出 在进行VB程序设计中,设计者并不需要自己编制VB程序代码来生成图形界面。VB提供了大量现成的图形控件和其他一些控件,例如所熟悉的菜单、命令按钮、对话框等,供给用户“堆砌”起来构造自己想象中的图形界面,因此几乎不用书写什么程序代码,“画”上几笔就可完成程序员的构思,获得应用程序的图形界面。 VB应用程序图形界面的设计首先要从窗体开始,其他的一些控件基本上归属于窗体控件(很多是直接“画”在窗体上的),通常应把窗体定义成一个构成应用程序可见部分的窗口,而一个VB的应用程序应首先从设计窗体开始。 VB应用程序设计过程中重要考虑的问题是应用程序与用户的交互,而窗体可以实现将输出信息提供给用户。 6、常用控件:在窗体上用于输入、输出信息的图形或文字符号称为控件。为了方便用户开发应用程序,VB中提供了很多的控件,其中很多控件是windows本身的资源,如命令按钮、标签、文本框等,也有一些是为了增强用户界面,或是使用户界面美观实用而编制的ActiveX控件。 1.5、VB与API函数:VB无疑是最先进的编程工具之一,但在涉及windows 32位系统的核心编程方面,譬如一些高级功能的实现上,它仍然显得有些力不从心,这需要我们充分利用vb的强大的Windows API函数调用能力来弥补。作为一个编程初学者来说,API函数也许是一个时常耳闻却感觉有些神秘的东西。单看它的复杂语法,就足令人望而生畏,但是任何事物在我们深入了解它之前,总是会有这种感觉的。其实我们应该把API函数的来龙去脉搞清楚,破除对API函数的畏惧,使它成为我们编程的好助手。 大家可能在许多书上看到过API的英文全称(Application Programming Interface),WIN32 API也就是MicrosoftWindows 32位平台的应用程序编程接口。对这个定义的理解,需要追溯到操作系统的发展历史上,当WINDOWS操作系统开始占据主导地位的时候,开发WINDOWS平台下的应用程序成为人们的需要。而在WINDOWS程序设计领域处于发展的初期,WINDOWS程序员所能使用的编程工具唯有API函数,这些函数是WINDOWS提供给应用程序与操作系统的接口,他们犹如“积木块”一样,可以搭建出各种界面丰富,功能灵活的应用程序。所以可以认为API函数是构筑整个WINDOWS框架的基石,在它的下面是WINDOWS的操作系统核心,而它的上面则是所有的华丽的WINDOWS应用程序。(配图1) Windows应用程序 Win32Api函数(应用程序接口) Windows操作系统底层 图1 但是,那时的WINDOWS程序开发还是比较复杂的工作,程序员必须熟记一大堆常用的API函数,而且还得对WINDOWS操作系统有深入的了解。然而随着软件技术的不断发展,在WINDOWS平台上出现了很多优秀的可视化编程环境,程序员可以采用“即见即所得”的编程方式来开发具有精美用户界面和功能强大的应用程序。 这些优秀可视化编程环境操作简单、界面友好(诸如VB、VC++、DELPHI等),在这些 工具中提供了大量的类库和各种控件,它们替代了API的神秘功能,事实上这些类库和控件都是构架在WIN32 API函数基础之上的,是封装了的API函数的集合。它们把常用的API函数的组合在一起成为一个控件或类库,并赋予其方便的使用方法,所以极大的加速了WINDOWS应用程序开发的过程。有了这些控件和类库,程序员便可以把主要精力放在程序整体功能的设计上,而不必过于关注技术细节。 实际上如果我们要开发出更灵活、更实用、更具效率的应用程序,必然要涉及到直接使用API函数,虽然类库和控件使应用程序的开发简单的多,但它们只提供WINDOWS的一般功能,对于比较复杂和特殊的功能来说,使用类库和控件是非常难以实现的,这时就需要采用API函数来实现。 这也是API函数使用的场合,所以我们对待API函数不必刻来研究每一个函数的用法,那也是不现实的(能用的到的API函数有几千个呢)。正如某位人士所说:API不要去学,在需要的时候去查API帮助就足够了。 在VB中声明API函数有两种方法:如果我们只在某个窗体中使用API函数,我们可以在窗体代码的General部分声明它: 声明的语法是: Private Declare Function ... Private Declare Sub..... 这里必须采用Private声明,因为这个API函数只能被一个窗体内的程序所调用。 如果我们的程序有多个窗体构成,而且我们需要在多个窗体中使用同一个API函数,就需要在模块中声明了。 先添加一个模块,具体方法为:在设计程序时,选“project”菜单项下的子菜单项“Add Moudle” 然后采用如下语法声明: Public Declare Function.... Public Declare Sub.... Public声明的含义是把API函数作为一个公共函数或过程,在一个工程中的任何位置(包括所有的窗体和模块)都能直接调用它。 声明完毕我们就能在程序中使用此API函数了。 可采用以下几种方式使用API函数,以SetWindowPos函数为例: (1)忽略函数返回值的调用: SetWindowPos Form1.hWnd, -2 ,0 ,0 ,0, 0, 3 注意此时函数的参数是不加括号的。 (2)Call方法调用: Call SetWindowPos(Form1.hWnd, -2, 0, 0, 0, 3) 注意这里需要加上括号,但我们不取回函数的返回值。 (3)取得函数返回值的调用: MyLng = SetWindowPos(Form1.hWnd, -2, 0, 0, 0,3) 此时需要加上括号,而且我们必须事先定义一个变量(变量的类型与函数返回值类型相同)来存储API函数的返回值。 几个问题的说明: (1)声明中的Lib 和 Alias 是怎么回事 一般情况下WIN32API函数总是包含在WINDOWS系统自带的或是其它公司提供的动态连接库DLL中,而Declare语句中的Lib关键字就用来指定DLL(动态连接库)文件的路径,这样VB才能找到这个DLL文件,然后才能使用其中的API函数。如果我们只是列出DLL文件名而不指出其完整的路径的话,VB会自动到.EXE文件所在目录、当前工作目录、WINDOWS\SYSTEM目录、WINDOWS目录下搜寻这个DLL文件。所以如果所要使用DLL文件不在上述几个目录下的话,我们应该指明其完整路径。 Alias用于指定API函数的别名,如果我们调用的API函数要使用字符串(参数中包含String型)的话,Alias关键字是必须的。这是因为在ANSI和Unicode字符集中同一API函数的名称可能是不一样的,为了保证不出现声明错误,我们使用Alias关键字指出API函数的别名,一般来说在WIN9X平台下我们把API函数名后加一个大写A作为别名即可。 (2)常见的API参数类型的说明 API函数的参数中最常见的是长整Long型数据类型,例如API中的句柄、一些特定的常量、函数的返回值都是此类型 的值;另外几种常见的参数类型有:整型Integer、Byte型、String型等。 (3)声明中的ByVal是作什么用的 这跟VB的参数传递方式有关,在默认情况下VB是通过地址传递方式传递函数的参数、而有些API函数要求必须采用传值方式来传递函数参数(这两种参数传递方式是不同的,前者传递的是一个指针,而后者要求是参数真实的值)。这样就会发生错误,解决的办法是在API函数参数声明的前面加上ByVal关键字,这样VB就采用传值方式传递参数了。 (4)怎样得到完整的API函数声明 VB自带了API文本查看器API TEXT VIEWER,我们可以在其中找到API函数的完整声明,然后把它粘贴到程序中即可。 了解了以上有关VB的基础知识,我们现在就可以开始着手运用VB进行程序设计了。 第四章 学生评语生成系统的开发 2(1、本软件将具有何种功能 1、能根据对某位学生的“德、智、体、美、劳”表现(即优秀、良好、一般、差)进行简单的选择,便能自动生成相应的评语。 2、可选择相应的寄语,以及加入个人的评语。 3、对生成的评语可以进行修改。 4、最后生成一个文本文件(.txt),使我们可方便地导入到wps或word中进行排版打印。 2(2、有关界面及控件设置 一、界面及控件设置如下图所示: 二、有关控件的属性 控件名称 属性 功能描述 Combo1 Text=’请选择寄语’ 供选择相应的寄语 Command1 Caption=”生成” Command2 Caption=”保存” 保存成.txt文件 Command3 Caption=“退出” Text1 供生成评语 Text2 供添加自定义评语 Text3 供输入姓名 Frame控件4个 分开德智体美劳五项 Option控件20个 细分成四个等级 Label控件3个 显示相应提示信息 2(3、源代码 Option Explicit '声明德智体美劳变量 Dim Mind As String, Score As String, PE As String Dim Manner As String, Labor As String, jy As String Private Sub Combo1_Click() jy = Combo1.Text End Sub '生成 Private Sub Command1_Click() If Text3.Text = "" Then MsgBox "姓名栏不能为空", vbOKOnly, "提示" Text3.SetFocus Text1.Text = "" Else Text1 = " " + Text3.Text + "同学一学期来" + Mind + Score + _ PE + Manner + Labor + Text2.Text + jy End If End Sub '保存 Private Sub Command2_Click() Dim sF As String sF = Text3.Text + ".txt" Open sF For Output As #1 Print #1, Text1.Text Close #1 End Sub Private Sub Command3_Click() End '退出 End Sub '德 Private Sub Option1_Click(Index As Integer) Select Case Index Case 0 Mind = "各方面从高从严要求自己,上进心强,遵守纪律。" Case 1 Mind = "思想上要求进步,严于律已,能较好地遵守校纪班规。" Case 2 Mind = "有一定的上进心,基本上能遵守学校的规章制度。" Case 3 Mind = "思想纪律表现一般,基本上能遵守校纪班规,但自律能力不强, 偶尔" + "有意外行为。" End Select End Sub '智 Private Sub optScore_Click(Index As Integer) Select Case Index Case 0 Score = "学习能力出众,勤奋用功,成绩优异,如保持下去,前途无限。" Case 1 Score = "学习能力较好,肯下功夫,成绩优良,有较好的发展潜力。" Case 2 Score = "有一定的自学能力,所作出的努力取得相应的成绩,挖掘潜力可观。" Case 3 Score = "学习上用心程度不够,成绩不太理想,但悟性较好,经努力会很快有 长足进步的。" End Select End Sub '体 Private Sub Option3_Click(Index As Integer) Select Case Index Case 0 PE = "热爱体育,积极参加体育锻炼,体能素质优良,身体健康。" Case 1 PE = "爱好体育,主动参加体育锻炼,体能素质良好,身体健康。" Case 2 PE = "基本上按要求参加体育锻炼,成绩合格。" Case 3 PE = "体育方面不太理想,身体素质有待加强。" End Select End Sub '美 Private Sub Option4_Click(Index As Integer) Select Case Index Case 0 Manner = "为人诚实,尊重老师、长辈,团结同学,乐于助人。" Case 1 Manner = "待人有礼貌,尊重师长、团结同学。" Case 2 Manner = "和气待人,与同学和好相处。" Case 3 Manner = "举止有进欠周到,望加强修养。" End Select End Sub '劳 Private Sub Option2_Click(Index As Integer) Select Case Index Case 0 Labor = "热爱劳动,有吃苦耐劳的精神。" Case 1 Labor = "劳动积极肯干,能吃苦耐劳。" Case 2 Labor = "劳动课能完成任务,但主动性有待提高。" Case 3 Labor = "劳动方面认识不足,表现一般。" End Select End Sub 第三章 毕业设计总结 历时一个多月的毕业设计终于快到了尾声,通过这次毕业设计,在老师的指导下,我初步掌握了用VB开发软件的方法,我在进行设计软件时遇到了一些困难,于是我在老师的提示和鼓励下,查资料,上网和网友进行探讨。我在程序员之家,网址为上的论坛和高手进行交流,对我受益菲浅。此外我还登录到天极网站看了不少优秀的vb技术文章。这些对我搞好毕业设计起了至关重要的作用。在此再次感谢××××大学的指导老师对我的悉心指导与帮助。由于时间仓促,这个软件肯定还有不完善的地方,比如评语的内容还不太丰富。这有待我以后继续完善,肯请各位老师提出批评改进意见。 第五章 程序运行软硬件环境 1、软件环境:操作系统是windowsxp专业版,在VisualBasic6.0编程环境下编译。 2、硬件环境:p4赛扬2.4G,DDR256M内存,60G硬盘空间。 第五章 主要参考文献 1、《Visual Basic 程序设计》清华大学出版 2002年7月第1版 李大友主编 2、《Visual Basic开发人员指南》机械工业出版社 1999年1月 EricBrierley主编 3、《Visual Basic 程序设计》中央电大出版 2000年12月第1版 陈明 主编 4、《Visual Basic6.0实效编程百例》人民邮电出版社 2002年7月 刘韬、骆娟主编 5、《数据结构(c++描述)》 中央电大出版 2000年12月第1版 徐孝凯主编 h? What I say? I speak true when I say dat Buck two devils." This was Francois's speech next morning when he discovered Spitz missing and Buck covered with wounds. He drew him to the fire and by its light pointed them out. "Dat Spitz fight like hell," said Perrault, as he surveyed the gaping rips and cuts. "An' dat Buck fight like two hells," was Francois's answer. "And now we make good time. No more Spitz, no more trouble, sure." While Perrault packed the camp outfit and loaded the sled, the dog-driver proceeded to harness the dogs. Buck trotted up to the place Spitz would have occupied as leader; but Francois, not noticing him, brought Sol-leks to the coveted position. In his judgment, Sol-leks was the best lead-dog left. Buck sprang upon Sol-leks in a fury, driving him back and standing in his place. "Eh? Eh?" Francois cried, slapping his thighs gleefully. "Look at dat Buck. Him kill dat Spitz, him think to take de job." "Go 'way, Hook!" he cried, but Buck refused to budge. He took Buck by the scruff of the neck, and though the dog growled threateningly, dragged him to one side and replaced Sol-leks. The old dog did not like it, and showed plainly that he was afraid of Buck. Francois was obdurate, but when he turned his back, Buck again displaced Sol-leks, who was not at all unwilling to go. Francois was angry. "Now, by Gar, I fix you!" he cried, coming back with a heavy club in his hand. Buck remembered the man in the red sweater, and retreated slowly; nor did he attempt to charge in when Sol-leks was once more brought forward. But he circled just beyond the range of the club, snarling with bitterness and rage; and while he circled he watched the club so as to dodge it if thrown by Francois, for he was become wise in the way of clubs. The driver went about his work, and he called to Buck when he was ready to put him in his old place in front of Dave. Buck retreated two or three steps. Francois followed him up, whereupon he again retreated. After some time of this, Francois threw down the club, thinking that Buck feared a thrashing. But Buck was in open revolt. He wanted, not to escape a clubbing, but to have the leadership. It was his by right. He had earned it, and he would not be content with less. Perrault took a hand. Between them they ran him about for the better part of an hour. They threw clubs at him. He dodged. They cursed him, and his fathers and mothers before him, and all his seed to come after him down to the remotest generation, and every hair on his body and drop of blood in his veins; and he answered curse with snarl and kept out of their reach. He did not try to run away, but retreated around and around the camp, advertising plainly that when his desire was met, he would come in and be good. Francois sat down and scratched his head. Perrault looked at his watch and swore. Time was flying, and they should have been on the trail an hour gone. Francois scratched his head again. He shook it and grinned sheepishly at the courier, who shrugged his shoulders in sign that they were beaten. Then Francois went up to where Sol-leks stood and called to Buck. Buck laughed, as dogs laugh, yet kept his distance. Francois unfastened Sol-leks's traces and put him back in his old place. The team stood harnessed to the sled in an unbroken line, ready for the trail. There was no place for Buck save at the front. Once more Francois called, and once more Buck laughed and kept away. "Throw down de club," Perrault commanded. Francois complied, whereupon Buck trotted in, laughing triumphantly, and swung around into position at the head of the team. His traces were fastened, the sled broken out, and with both men running they dashed out on to the river trail. Highly as the dog-driver had forevalued Buck, with his two devils, he found, while the day was yet young, that he had undervalued. At a bound Buck took up the duties of leadership; and where judgment was required, and quick thinking and quick acting, he showed himself the superior even of Spitz, of whom Francois had never seen an equal. But it was in giving the law and making his mates live up to it, that Buck excelled. Dave and Sol-leks did not mind the change in leadership. It was none of their business. Their business was to toil, and toil mightily, in the traces. So long as that was not interfered with, they did not care what happened. Billee, the good-natured, could lead for all they cared, so long as he kept order. The rest of the team, however, had grown unruly during the last days of Spitz, and their surprise was great now that Buck proceeded to lick them into shape. Pike, who pulled at Buck's heels, and who never put an ounce more of his weight against the breastband than he was compelled to do, was swiftly and repeatedly shaken for loafing; and ere the first day was done he was pulling more than ever before in his life. The first night in camp, Joe, the sour one, was punished soundly--a thing that Spitz had never succeeded in doing. Buck simply smothered him by virtue of superior weight, and cut him up till he ceased snapping and began to whine for mercy. The general tone of the team picked up immediately. It recovered its old-time solidarity, and once more the dogs leaped as one dog in the traces. At the Rink Rapids two native huskies, Teek and Koona, were added; and the celerity with which Buck broke them in took away Francois's breath. "Never such a dog as dat Buck!" he cried. "No, never! Him worth one thousand dollair, by Gar! Eh? What you say, Perrault?" And Perrault nodded. He was ahead of the record then, and gaining day by day. The trail was in excellent condition, well packed and hard, and there was no new-fallen snow with which to contend. It was not too cold. The temperature dropped to fifty below zero and remained there the whole trip. The men rode and ran by turn, and the dogs were kept on the jump, with but infrequent stop-pages. The Thirty Mile River was comparatively coated with ice, and they covered in one day going out what had taken them ten days coming in. In one run they made a sixty-mile dash from the foot of Lake LeBarge to the White Horse Rapids. Across Marsh, Tagish, and Bennett (seventy miles of lakes), they flew so fast that the man whose turn it was to run towed behind the sled at the end of a rope. And on the last night of the second week they topped White Pass and dropped down the sea slope with the lights of Skaguay and of the shipping at their feet. It was a record run. Each day for fourteen days they had averaged forty miles. For three days Perrault and Francois threw chests up and down the main street of Skaguay and were deluged with invitations to drink, while the team was the constant center of a worshipful crowd of dogbusters and mushers. Then three or four western bad men aspired to clean out the town, were riddled like pepperboxes for their pains, and public interest turned to other idols. Next came official orders. Francois called Buck to him, threw his arms around him, wept over him. And that was the last of Francois and Perrault. Like other men, they passed out of Buck's life for good. A Scotch half-breed took charge of him and his mates, and in company with a dozen other dog-teams he started back over the weary trail to Dawson. It was no light running now, nor record time, but heavy toil each day, with a heavy load behind; for this was the mail train, carrying word from the world to the men who sought gold under the shadow of the Pole. Buck did not like it, but he bore up well to the work, taking pride in it after the manner of Dave and Sol-leks, and seeing that his mates, whether they prided in it or not, did their fair share. It was a monotonous life, operating with machine-like regularity. One day was very like another. At a certain time each morning the cooks turned out, fires were built, and breakfast was eaten. Then, while some broke camp, others harnessed the dogs, and they were under way an hour or so before the darkness fell which gave warning of dawn. At night, camp was made. Some pitched the tents, others cut firewood and pine boughs for the beds, and still others carried water or ice for the cooks. Also, the dogs were fed. To them, this was the one feature of the day, though it was good to loaf around, after the fish was eaten, for an hour or so with the other dogs, of which there were fivescore and odd. There were fierce fighters among them, but three battles with the fiercest brought Buck to mastery, so that when he bristled and showed his teeth, they got out of his way. Best of all, perhaps, he loved to lie near the fire, hind legs crouched under him, fore legs stretched out in front, head raised, and eyes blinking drearily at the flames. Sometimes he thought of Judge Miller's big house in the sun-kissed Santa Clara Valley, and of the cement swimming tank, and Ysabel, the Mexican hairless, and Toots, the Japanese pug; but oftener he remembered the man in the red sweater, the death of Curly, the great fight with Spitz and the good things he had eaten or would like to eat. He was not homesick. The Sunland was very dim and distant, and such memories had no power over him. Far more potent were the memories of his heredity that gave things he had never seen before a seeming familiarity; the instincts (which were but the memories of his ancestors become habits) which had lapsed in later days, and still later, in him, quickened and became alive again. Sometimes as he crouched there, blinking dreamily at the flames, it seemed that the flames were of another fire, and that as he crouched by this other fire he saw another and different man from the half-breed cook before him. This other man was shorter of leg and longer of arm, with muscles that were stringy and knotty rather than rounded and swelling. The hair of this man was long and matted, and his head slanted back under it from the eyes. He uttered strange sounds, and seemed very much afraid of the darkness, into which he peered continually, clutching in his hand, which hung midway between knee and foot, a stick with a heavy stone made fast to the end. He was all but naked, a ragged and fire-scorched skin hanging part way down his back, but on his body there was much hair. In some places, across the chest and shoulders and down the outside of the arms and thighs, it was matted into almost a thick fur. He did not stand erect, but with trunk inclined forward from the hips, on legs that bent at the knees. About his body there was a peculiar springiness, or resiliency, almost catlike, and a quick alertness as of one who lived in perpetual fear of things seen and unseen. At other times this hairy man squatted by the fire with head between his legs and slept. On such occasions his elbows were on his knees, his hands clasped above his head as though to shed rain by the hairy arms. And beyond that fire, in the circling darkness, Buck could see many gleaming coals, two by two, always two by two, which he knew to be the eyes of great beasts of prey. And he could hear the crashing of their bodies through the undergrowth, and the noises they made in the night. And dreaming there by the Yukon bank, with lazy eyes blinking at the fire, these sounds and sights of another world would make the hair to rise along his back and stand on end across his shoulders and up his neck, till he whimpered low and suppressedly, or growled softly, and the half-breed cook shouted at him, "Hey, you Buck, wake up!" Whereupon the other world would vanish and the real world come into his eyes, and he would get up and yawn and stretch as though he had been asleep. It was a hard trip, with the mail behind them, and the heavy work wore them down. They were short of weight and in poor condition when they made Dawson, and should have had a ten days' or a week's rest at least. But in two days' time they dropped down the Yukon bank from the Barracks, loaded with letters for the outside. The dogs were tired, the drivers grumbling, and to make matters worse, it snowed every day. This meant a soft trail, greater friction on the runners, and heavier pulling for the dogs; yet the drivers were fair through it all, and did their best for the animals. Each night the dogs were attended to first. They ate before the drivers ate, and no man sought his sleeping-robe till he had seen to the feet of the dogs he drove. Still, their strength went down. Since the beginning of the winter they had traveled eighteen hundred miles, dragging sleds the whole weary distance; and eighteen hundred miles will tell upon life of the toughest. Buck stood it, keeping his mates up to their work and maintaining discipline, though he too was very tired. Billee cried and whimpered regularly in his sleep each night. Joe was sourer than ever, and Sol-leks was unapproachable, blind side or other side. But it was Dave who suffered most of all. Something had gone wrong with him. He became more morose and irritable, and when camp was pitched at once made his nest, where his driver fed him. Once out of the harness and down, he did not get on his feet again till harness-up time in the morning. Sometimes, in the traces, when jerked by a sudden stoppage of the sled, or by straining to start it, he would cry out with pain. The driver examined him, but could find nothing. All the drivers became interested in his case. They talked it over at meal-time, and over their last pipes before going to bed, and one night they held a consultation. He was brought from his nest to the fire and was pressed and prodded till he cried out many times. Something was wrong inside, but they could locate no broken bones, could not make it out. By the time Cassiar Bar was reached, he was so weak that he was falling repeatedly in the traces. The Scotch half-breed called a halt and took him out of the team, making the next dog, Sol-leks, fast to the sled. His intention was to rest Dave, letting him run free behind the sled. Sick as he was, Dave resented being taken out, grunting and growling while the traces were unfastened, and whimpering broken-heartedly when he saw Sol-leks in the position he had held and served so long. For the pride of trace and trail was his, and, sick unto death, he could not bear that another dog should do his work. When the sled started, he floundered in the soft snow alongside the beaten trail, attacking Sol-leks with his teeth, rushing against him and trying to thrust him off into the soft snow on the other side, striving to leap inside his traces and get between him and the sled, and all the while whining and yelping and crying with grief and pain. The half-breed tried to drive him away with the whip; but he paid no heed to the stinging lash, and the man had not the heart to strike harder. Dave refused to run quietly on the trail behind the sled, where the going was easy, but continued to flounder alongside in the soft snow, where the going was most difficult, till exhausted. Then he fell, and lay where he fell, howling lugubriously as the long train of sleds churned by. With the last remnant of his strength he managed to stagger along behind till the train made another stop, when he floundered past the sleds to his own, where he stood alongside Sol-leks. His driver lingered a moment to get a light for his pipe from the man behind. Then he returned and started his dogs. They swung out on the trail with remarkable lack of exertion, turned their heads uneasily, and stopped in surprise. The driver was surprised, too; the sled had not moved. He called his comrades to witness the sight. Dave had bitten through both of Sol-lek's traces, and was standing directly in front of the sled in his proper place. He pleaded with his eyes to remain there. The driver was perplexed. His comrades talked of how a dog could break its heart through being denied the work that killed it, and recalled instances they had known, where dogs, too old for the toil, or injured, had died because they were cut out of the traces. Also, they held it a mercy, since Dave was to die anyway, that he should die in the traces, heart-easy and content. So he was harnessed in again, and proudly he pulled as of old, though more than once he cried out involuntarily from the bite of his inward hurt. Several times fell down and was dragged in the traces, and once the sled ran upon him so that he limped thereafter on one of his hind legs. But he held out till camp was reached, when his driver made a place for him by the fire. Morning found him too weak to travel. At harness-up time he tried to crawl to his driver. By convulsive efforts he got on his feet, staggered, and fell. Then he wormed his way forward slowly toward where the harnesses were being put on his mates. He would advance his fore legs and drag up his body with a sort of hitching movement, when he would advance his fore legs and hitch ahead again for a few more inches. His strength left him, and the last his mates saw of him he lay gasping in the snow and yearning toward them. But they could hear him mournfully howling till they passed out of sight behind a belt of river timber. Here the train was halted. The Scotch half-breed slowly retraced his steps to the camp they had left. The men ceased talking. A revolver-shot rang out. The man came back hurriedly. The whips snapped, the bells tinkled merrily, the sleds churned along the trail; but Buck knew, and every dog knew, what had taken place behind the belt of river trees. LastIndexNextinant primordial beast was strong in Buck, and under the fierce conditions of trail life it grew and grew. Yet it was a secret growth. His newborn cunning gave him poise and control. He was too busy adjusting himself to the new life to feel at ease, and not only did he not pick fights, but he avoided them whenever possible. A certain deliberateness characterized his attitude. He was not prone to rashnes He openly threatened the other's leadership. He came between him and the shirks he should have punished. And he did it deliberately. One night there was a heavy snowfall, and in the morning Pike, the malingerer, did not appear. He was securely hidden in his nest under a foot of snow. Francois called him and sought him in vain. Spitz was wild with wrath. He raged through the camp, smelling and digging in every likely place, snarling so frightfully that Pike heard and shivered in his hiding-place. But when he was at last unearthed, and Spitz flew at him to punish him, Buck flew with equal rage, in between. So unexpected was it, and so shrewdly managed, that Spitz was hurled backward and off his feet. Pike, who had been trembling abjectly, took heart at this open mutiny, and sprang upon his overthrown leader. Buck, to whom fair play was a forgotten code, likewise sprang upon Spitz. But Francois, chuckling at the incident while unswerving in the administration of justice, brought his lash down upon Buck with all his might. This failed to drive Buck from his prostrate rival, and the butt of the whip was brought into play. Half-stunned by the blow, Buck was knocked backward and the lash laid upon him again and again, while Spitz soundly punished the many times offending Pike. In the days that followed, as Dawson grew closer and closer, Buck still continued to interfere between Spitz and the culprits; but he did it craftily, when Francois was not around. With the covert mutiny of Buck, a general insubordination sprang up and increased. Dave and Sol-leks were unaffected, but the rest of the team went from bad to worse. Things no longer went right. There was continual bickering and jangling. Trouble was always afoot, and at the bottom of it was Buck. He kept Francois busy, for the dog-driver was in constant apprehension of the life-and-death struggle between the two which he knew must take place sooner or later; and on more than one night the sounds of quarreling and strife among the other dogs turned him out of his sleeping robe, fearful that Buck and Spitz were at it. But the opportunity did not present itself, and they pulled into Dawson one dreary afternoon with the great fight still to come. Here were many men, and countless dogs, and Buck found them all at work. It seemed the ordained order of things that dogs should work. All day they swung up and down the main street in long teams, and in the night their jingling bells still went by. They hauled cabin logs and firewood, freighted up to the mines, and did all manner of work that horses did in the Santa Clara Valley. Here and there Buck met Southland dogs, but in the main they were the wild wolf husky breed. Every night, regularly, at nine, at twelve, and three, they lifted a nocturnal song, a weird and eerie chant, in which it was Buck's delight to join. With the aurora borealis flaming coldly overhead, or the stars leaping in the frost dance, and the land numb and frozen under its pall of snow, this song of the huskies might have been the defiance of life, only it was pitched in minor key, with long-drawn wailings and half-sobs, and was more the pleading of life, the articulate travail of existence. It was an old song, old as the breed itself--one of the first songs of the younger world in a day when songs were sad. It was invested with the woe of unnumbered generations, this plaint by which Buck was so strangely stirred. When he moaned and sobbed, it was with the pain of living that was of old the pain of his wild fathers, and the fear and mystery of the cold and dark that was to them fear and mystery. And that he should be stirred by it marked the completeness with which he harked back through the ages of fire and roof to the raw beginnings of life in the howling ages. Seven days from the time they pulled into Dawson, they dropped down the steep bank by the Barracks to the Yukon Trail, and pulled for Yea and Salt Water. Perrault was carrying dispatches if anything more urgent than those he had brought in; also, the travel pride had gripped him, and he purposed to make the record trip of the year. Several things favored him in this. The week's rest had recuperated the dogs and put them in thorough trim. The trail they had broken into the country was packed hard by later journeyers. And further, the police had arranged in two or three places deposits of grub for dog and man, and he was traveling light. They made Sixty Mile, which is a fifty-mile run, on the first day; and the second day saw them booming up the Yukon well on their way to Pelly. But such splendid running was achieved not without great trouble and vexation on the part of Francois. The insidious revolt led by Buck had destroyed the solidarity of the team. It no longer was as one dog leaping in the traces. The encouragement Buck gave the ath, the full pack at Buck's heels raised a hell's chorus of delight. Buck did not cry out. He did not check himself, but drove in upon Spitz, shoulder to shoulder, so hard that he missed the throat. They rolled over and over in the powdery snow. Spitz gained his feet almost as though he had not been overthrown, slashing Buck down the shoulder and leaping clear. Twice his teeth clipped together, like the steel jaws of a trap, as he backed away for better footing, with lean and lifting lips that writhed and snarled. In a flash Buck knew it. The time had come. It was to the death. As they circled about, snarling, ears laid back, keenly watchful for the advantage, the scene came to Buck with a sense of familiarity. He seemed to remember it all--the white woods, and earth, and moonlight, and the thrill of battle. Over the whiteness and silence brooded a ghostly calm. There was not the faintest whisper of air--nothing moved, not a leaf quivered, the visible breaths of the dogs rising slowly and lingering in the frosty air. They had made short work of the snowshoe rabbit, these dogs that were ill-tamed wolves; and they were now drawn up in an expectant circle. They, too, were silent, their eyes only gleaming and their breaths drifting slowly upward. To Buck it was nothing new or strange, this scene of old time. It was as though it had al
本文档为【学生评语生成系统的开发—计算机毕业设计(论文)】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
该文档来自用户分享,如有侵权行为请发邮件ishare@vip.sina.com联系网站客服,我们会及时删除。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
下载需要: 免费 已有0 人下载
最新资料
资料动态
专题动态
is_650122
暂无简介~
格式:doc
大小:160KB
软件:Word
页数:0
分类:工学
上传时间:2018-12-13
浏览量:15