新闻管理系统设计与实现

目  录

摘要

Abstract

1 绪论

1.1 系统开发背景及意义

1.2 国内外文献综述

1.3 软硬件环境

1.4 关键技术介绍

1.5 预期目标

1.6 内容介绍

2 可行性研究

2.1 技术可行性

2.2 经济可行性

2.3 操作可行性

2.4 法律可行性

2.5 可行性研究结论

3 需求分析

3.1 用户需求

3.2 系统的目的

3.3 系统业务流图

3.4 数据描述

3.4.1 数据流图

3.4.2 数据字典

3.5 E-R模型

4 软件设计

4.1 软件设计采用的方法

4.2 软件设计采用的技术

4.4 数据库设计

4.4.1 概念结构设计

4.4.2 逻辑结构设计

5 系统的详细设计

5.1 程序流程图

5.2 系统主要功能模块

5.2.1 管理员登录功能模块

5.2.2 用户管理功能模块

5.2.3 添加新闻功能模块

5.2.4 新闻管理功能模块

6 测试与运行记录

6.1 测试用例设计

6.1.1 测试方案

6.1.2 测试准备

6.1.3 测试用例

6.1.4 条件与限制

6.2 测试与运行记录

6.2.1 测试管理员登录功能模块

6.2.2 测试添加新闻功能模块

6.2.3 测试添加文章成功模块

6.2.4 测试新闻管理功能模块

6.2.5 测试用户管理功能模块

6.2.6 测试新闻审核功能模块

结束语

致 谢

英文原文

英文译文

参考文献

于ASP的Web新闻信息系统的设计与实现

计算机科学与技术  2005级  黄诗苹

摘要:新闻信息系统,可将需要动态变化的信息,如国内新闻、最新政策动态、通知等集中管理,并对信息进行加工,最后将其发布到WEB上。

本系统的开发环境是ASP,数据库服务器是ACCESS 2003,测试服务器是IIS。它的主要功能是新闻的自动创建,新闻的浏览、查找、审核、修改和删除。前台页面由模板自动生成,后台的管理系统则实现了对新闻和用户的各项管理。系统创新之处在于利用新闻模板自动创建新闻文件,实现了相关新闻和新闻评论功能,并利用数据库技术,动态地显示出推荐新闻信息和热点新闻信息。

关键字ASP;ACCESS;IIS 

Web-based ASP News Information System

Computer science and technology   GRADE 2005  Huang Shiping

Abstract:News and information system,it can manage the updated information such as china news, dynamic of the country,notice and so on. Sorting out the information via identity quality and then publishing them on website systematically and formally.

The system uses ASP as a development environment, ACCESS 2003 as a database server, IIS server as a test. Achieves the realization of the automatic creation of news, information browsing, retrieval, review, modify and delete. Prospects pages and custom templates generation, and user management system to achieve the background of the news and users of the management, completed a dynamic press releases all the features of the system. Highlights of the system is making use of news paper moulding board to create a template of news automatically, realizes the function of remarking on news and correlated news, and dynamic displays recommend and hot news and information with the database technology.

Keywords: ASP; ACCESS;IIS

1 绪论

1.1 系统开发背景及意义

    信息时代的今天,传递和获取信息的途径越来越多,其中网络以其跨时间、跨地域以及快速、高效,低成本的显著特性己经成为信息传递和信息获取的主要途径,而如何把信息以更快、更具表达力地发布到网上己经成了各单位部门急需解决的问题。因此,网站作为互联网信息发布和管理平台越来越受到重视。

    新闻信息系统是上个世纪九十年代互连网技术发展以后才出现的技术,最初表现是解决一些网站的信息动态发布而开发,只是简单的发布和显示,应用对于各种不同的站点需要构建不同的系统来满足需要,而且功能单一。在九十年代后期,互连网技术进一步发展,网络作为新起的新闻媒介工具,其用户大大增加,对系统的要求也越来越高,新闻信息系统在这样的一个环境中提出、开发、并改进。到现在,新闻信息系统开发的成功案例己经不计其数,各行各业的绝大部分的网站都使用到了新闻信息系统,大量的用户引发了新闻信息系统功能的进一步扩大和深化,给新闻信息系统提出了更高的要求。

    信息化迅猛发展,对信息生产、管理和发布的要求也更迫切。不同的部门由于其工作领域、规模的不同,对信息系统的需求也各有其特色。本项目开发的新闻信息系统提供信息生产、管理和发布,各部门可以随时方便地提交需要发布的信息而无须掌握复杂的技术。鉴于现有的新闻信息响应速度慢、时效性差、质量低且待发布信息难以管理与控制等缺点,开发技术先进、功能强大和可靠性高的新闻信息系统就具有特别重要的意义。

1.2 国内外文献综述

本研究课题范围内已有的文献有《ASP数据库开发实例精粹》、《数据库应用开发综合实例教程》、《ASP网络开发从入门到精通》等。

1.3 软硬件环境

硬件要求:

 CPU:P3或者以上

 内存:64MB或者以上

 硬盘:50M或者以上

数据库环境:ACCESS 2003

服务器环境:Windows XP+IIS 5.0

1.4 关键技术介绍

该系统使用ASP技术开发, 实现了新闻的动态管理,使得对信息的管理更加及时、高效,提高了工作效率。该新闻信息系统具有一般新闻系统的功能,包括前台新闻查看区和后台管理区,可为各部门发布新闻,为网站提供新闻信息与管理的服务。

该系统是基于B/S(Browser/Server,浏览器/客户端)模式实现,主要实现对新闻的发布与管理功能,对新闻内容信息的浏览阅读等。随着Internet/Intranet技术的兴起,将原本在单机或本地局域网上运行的数据库系统移植到因特网中,即开发基于B/S模式的新一代MIS系统,正成为技术发展的趋势。它可以保证系统性能的高效性、可扩展性,以及达到数据共享和网络化管理的目的。

1.5 预期目标

    根据新闻信息的需求,在ACCESS数据库中实现新闻数据表的设计与存储,设计并开发新闻管理模块的用户登录、添加/修改删除新闻、新闻列表等功能;发布管理模块的浏览新闻、新闻搜索、分类新闻、新闻中心和网站首页等功能,最终实现网站首页、新闻中心、新闻内容的动态发布。

1.6 内容介绍

此设计将用5章的内容详细介绍新闻信息系统的需求及其分析过程。具体安排情况如下:

一、系统概述。重点阐述问题的提出背景,了解国内外现状,明确研究此课题的实际意义。

二、可行性研究与需求分析。从客户角度了解此系统需要解决的问题,从而决定以后的重点开发方向[1]。

三、总体设计。从整体结构上设计此系统的实现方案。

四、系统的详细设计及编码实现。用户操作层分别阐述实现方法。

五、测试与运行记录。给出测试方案,检验系统的逻辑功能是否与预期结果相符合。


2 可行性研究

2.1 技术可行性

该新闻信息系统是基于ASP 技术,建立以ACCESS为结构模式、以数据库为后台核心应用、以服务为目的信息平台,对新闻进行科学管理,它是建立在互联网上的应用系统,配置可以极为简单。这套系统应该具有先进的技术特征;配置必要的数据库和应用服务程序;组织完整的管理员操作界面。

2.2 经济可行性

经济可行性主要依据是成本/效益分析,该系统的目标是以最低的成本,在最短的期限内开发出具有新闻信息管理功能的系统。

该系统的目标是以最低的成本,在较短的时间内开发,目标系统并不是十分的复杂。当系统开发完实际运行后,将在很大程度上提高计算机的功能,而在为使用者带来便利的同时,也为系统的进一步推广创造了条件。这带来的经济回报将远超过支出,并且最重要的是该软件的开发可以使我们对系统的开发有全面的认识。因此从经济角度考虑,此新闻信息系统开发可行。

2.3 操作可行性

工作人员要求一定的计算机基础,系统管理员要求计算机的专业知识。

2.4 法律可行性

从法律因素考虑,所有技术资料都由提出保管,所有软件都选用正版,合同制定确定违约责任。

2.5 可行性研究结论

鉴于以上分析可知,该新闻信息系统开发项目不仅有巨大的经济效益,而且有巨大的社会效益。从而使我们深信该系统开发出来之后将获得巨大的成功!

综上所述,该项目在技术方面、经济方面、操作方面和社会效益等方面上是完全可行的。


3 需求分析

3.1 用户需求

对于用户来说,他们所关心的就是新闻的浏览﹑新闻的搜索和新闻的评论,同时还得兼顾栏目路径信息﹑新闻图片信息﹑推荐新闻信息﹑新闻点击信息和新闻审核信息。

通过系统的功能分析,针对一般的信息系统的用户,总结出如下需求分析:

1)每条栏目对应一个文件夹。

2)每条信息对应一个ASP 文件。

3)每条信息只能对应一个栏目。

4)每条信息对应一个信息模板。

5)每个新闻模板对应不同栏目的多条新闻。

6)每个栏目下面可有多条新闻。

7)不同栏目的新闻对应的关键字可以相同。

8)每条新闻必须经审核通过后才能对用户开放。

9)每条新闻除包含新闻的基本信息之外,还得包含路径信息﹑图片信息﹑推荐新闻信息﹑新闻点击信息等。

对于管理员来说,他们所关心的是如何对栏目和新闻进行添加﹑审核﹑修改﹑删除。不同的管理员权限应有不同,可分为三等:一等为高级管理员,什么操作都可以做;而等为审核管理员,可以对新闻进行审核;三等为新闻录入人员,只能对新闻进行录入,通过以上分析,针对系统管理员,总结出如下需求信息:

1)管理员有不同的权限。

2)管理员可以对栏目进行增﹑删﹑改。

3)管理员可以对新闻进行增﹑删﹑改。

4)管理员可以对行文模板进行增﹑删﹑改。

5)管理员可以对新闻进行审核。

6)管理员可以对用户进行管理。

3.2 系统的目的

本新闻信息系统的目的是根据后台管理员设置的栏目和绑定的模板自动生成前台新闻主页、栏目浏览页面和新闻浏览页面,同时后台提供了栏目、模板、新闻的编辑、修改和删除功能,完成了新闻信息系统的所有功能。

人们对最新信息的需求和发布迫切的需要及时性,而动态交互式网页刚好提供了这些功能,本系统就是能够在网上实现新闻的网上多用户发布,多栏目管理的网上交互系统。

3.3 系统业务流图

新闻信息系统的工作主要是涉及到两个方面,一方面是对新闻本身的数据管理操作,另一方面是给用户提供查看新闻内容的功能。因此,新闻信息系统的新闻后台管理员通过登录验证获得后台管理新闻数据权限,利用新闻管理和发布管理等子系统完成系统业务,图3.1为新闻信息系统的业务流图。

图 3.1 系统业务流图

3.4 数据描述

3.4.1 数据流图

数据流图(DFD)是一种图形化技术,它描绘信息流和数据从输入移动到输出的过程中所经受的变换[5]。

1)本系统中使用的数据流图符号如图3.2所示:

图3.2 数据流图符号

2)本系统的总体数据流图如图3.3所示:

图3.3系统总体数据流图

3)本系统的管理员设置数据流图如图3.4所示:

图3.4 管理员设置数据流图

4)本系统的用户数据流图:

图3.5用户功能数据流图

5)本系统的系统功能细化数据流图:

图3.6系统功能细化数据流图

3.4.2 数据字典

数据字典是关于数据的信息的集合,也就是对数据流图中包含的所有元素的定义的集合。数据流图和数据字典共同构成系统的逻辑模型。

下面用数据字典来定义数据流图中各元素的确切内容。

  1. 数据项

表3-1 新闻栏目表(type)

描述

类型

长度

主键

默认值

栏目编号

长整型

8

自动编号

栏目名称

文本

20

Null

栏目路径名

文本

50

Null

栏目加入时间

日期/时间

10

Now()

表3-2 新闻表(article)

描述

类型

长度

主键

默认值

新闻编号

长整型

8

自动编号

新闻标题

文本

100

Null

新闻所对应的文件名

文本

50

Null

新闻所在的文件夹名称

文本

50

Null

新闻正文内容

备注

不限

Null

新闻所属栏目编号

数字

8

Null

新闻所属栏目名称

文本

50

Null

新闻作者

文本

50

Null

推荐新闻标识

数字

8

0

新闻来源

文本

50

Null

新闻审核标识

数字

8

0

新闻关键字

文本

50

Null

新闻点击次数

数字

8

0

新闻评论内容

备注

不限

Null

图片新闻标识

数字

8

0

图片的路径

文本

50

Null

新闻包含图片的标识

数字

8

0

新闻加入的时间

日期/时间

10

Now()

表3-3 新闻模板表(Example)

描述

类型

长度

主键

默认值

新闻模板编号

长整型

8

自动编号

新闻模板内容

备注

不限

Null

新闻模板名称

文本

50

Null

表3-4 管理员(admin)

描述

类型

长度

主键

默认值

管理员编号

长整型

8

自动编号

管理员用户名

文本

50

Null

管理员密码

文本

50

Null

管理员权限

文本

50

Null

2)数据流

表3-5 口令及密码数据流

表3-6 验证结果数据流表

表3-7 更新结果数据流

表3-8 管理员信息存储

表3-9 新闻栏目信息存储

表3-10 新闻内容信息存储

3)数据处理:

表3-11 管理员登陆处理

表3-12 新闻信息处理

3.5 E-R模型

图3.7 实体之间的关系E-R图

实体之间关系的E-R图如图3.7所示。本设计根据上面的设计规划出的实体有:管理员信息实体﹑新闻栏目信息实体﹑新闻实体﹑新闻模板实体。 


4 软件设计

4.1 软件设计采用的方法

本系统根据用户要求浏览用户无需安装软件都可以直接与服务器端进行信息交流,服务器端由管理员用来管理,因此采用B/S结构。

B/S结构(Browser/Server结构)结构即浏览器和服务器结构。它是随着Internet技术的兴起,对C/S结构的一种变化或者改进的结构。在这种结构下,用户工作界面是通过WWW浏览器来实现,极少部分事务逻辑在前端(Browser)实现,但是主要事务逻辑在服务器端(Server)实现,形成所谓三层结构。这样就大大简化了客户端电脑载荷,减轻了系统维护与升级的成本和工作量,降低了用户的总体成本。

一、B/S结构的优点

      B/S结构最大的优点就是可以在任何地方进行操作而不用安装任何专门的软件。只要有一台能上网的电脑就能使用,客户端零维护。

二、B/S架构软件的优势与劣势

1)维护和升级方式简单。目前,软件系统的改进和升级越来越频繁,B/S架构的产品明显体现着更为方便的特性。对一个稍微大一点的单位来说,系统管理人员如果需要在几百甚至上千部电脑之间来回奔跑,效率和工作量是可想而知的,但B/S架构的软件只需要管理服务器就行了,所有的客户端只是浏览器,根本不需要做任何的维护。无论用户的规模有多大,有多少分支机构都不会增加任何维护升级的工作量,所有的操作只需要针对服务器进行;如果是异地,只需要把服务器连接专网即可,实现远程维护、升级和共享。

       2)成本降低,选择更多。大家都知道windows在桌面电脑上几乎一统天下,浏览器成为了标准配置,但在服务器操作系统上windows并不是处于绝对的统治地位。 现在的趋势是凡使用B/S架构的应用管理软件,只需安装在Linux服务器上即可,而且安全性高。所以服务器操作系统的选择是很多的,不管选用那种操作系统都可以让大部分人使用windows作为桌面操作系统电脑不受影响,这就使的最流行免费的Linux操作系统快速发展起来,这种选择非常盛行。

       3)应用服务器运行数据负荷较重。由于B/S架构管理软件只安装在服务器端(Server)上,网络管理人员只需要管理服务器就行了,用户界面主要事务逻辑在服务器(Server)端完全通过WWW浏览器实现,极少部分事务逻辑在前端(Browser)实现,所有的客户端只有浏览器,网络管理人员只需要做硬件维护。但是,应用服务器运行数据负荷较重,一旦发生服务器“崩溃”等问题,后果不堪设想。因此,许多单位都备有数据库存储服务器,以防万一。

4.2 软件设计采用的技术

基于Web的系统开发工具应使开发者使用各种各样的技术来创建动态的Web应用程序,并且应是一个可视化的工具。我们采用了Macromedia Dreamweaver 8进行开发,它是用来快速创建数据驱动Web应用程序的基于团队的开发环境,支持ASP,脚本语言为简单易学的JavaScript或VBScript。

1)ASP

ASP 全称为 Active Server Pages(动态服务器主页),它是一种应用程序环境,可以利用 VBscript 或 JavaScript 语言来设计,主要用于网络数据库的查询与管理。其工作原理是当浏览者发出浏览请求的时候,服务器会自动将 ASP 的程序码,解释为标准 HTML 格式的网页内容,再送到浏览者浏览器上显示出来。我们也可以将 ASP 理解为一种特殊的 CGI。

ASP具有学习快、设计快的特点,不需花许多时间即可学会和快速设计出WEB应用程序。ASP的源程序码在服务器端执行,代码保密性好。集成与HTML中,无需编译链接可直接执行,而且使用文本编辑器即可设计。

2)Access数据库简介

Access 是微软公司推出的基于Windows的桌面关系数据库管理系统(RDBMS),是Office系列应用软件之一。它提供了表、查询、窗体、报表、页、宏、模块7种用来建立数据库系统的对象;提供了多种向导、生成器、模板,把数据存储、数据查询、界面设计、报表生成等操作规范化;为建立功能完善的数据库管理系统提供了方便,也使得普通用户不必编写代码,就可以完成大部分数据管理的任务。

4.3 系统功能模块设计  

系统的功能模块图如下图所示:

图4.1系统功能模块图

该系统主要分为以下几个模块:

1)新闻显示功能模块:主要功能是显示新闻。

2)搜索新闻功能模块:包含按新闻标题搜索和按新闻内容搜索两个模块。

3)新闻评论模块:包含发表评论和浏览评论两个模块。

4)用户管理功能模块:包含用户添加、用户删除、用户修改密码三个模块。

5)新闻模版管理功能模块:包含模版修改、模版删除两个模块。

6)新闻栏目管理模块:包含栏目的添加、栏目的删除、栏目的修改三个模块。

7)新闻管理功能模块:包括新闻的添加、新闻的删除两个模块。

8)添加新闻功能模块:包括添加新闻、生成首页新闻两个模块。

9)新闻审核功能模块:主要功能是审核新闻。

4.4 数据库设计

4.4.1 概念结构设计

将需求分析阶段所得到的用户应用需求抽象为信息世界的结构的过程就是概念结构设计,它是独立于任何一种数据模型的信息结构。它是整个数据库设计的关键。

概念结构的主要特点是:

1)能真实、充分的反映现实世界,包括事物和事物之间的联系,能满足用户对数据的处理要求。是对现实世界的一个真实模型。

2)易于理解,从而可以用它和不熟悉计算机的用户交换意见,用户的积极参与是数据库的设计成功的关键。

3)易于更改,当应用环境和应用要求改变时,容易对概念模型修改和扩充。

4)易于向关系、网状、层次等各种数据模型转换。

    得到需求分析的数据项和数据结构以后,就可以设计出能够满足用户需求的各种实体,以及它们之间的关系,为后面的逻辑结构设计打下基础。这些实体包含各种具体信息,通过相互之间的作用形成数据的流动。

4.4.2 逻辑结构设计

经过系统功能分析和需求总结,考虑到将来功能上的扩展,设计如下的数据项和数据结构:

    1)管理员信息,包括数据项: 用户名,密码,权限。

    2)栏目信息,包括数据项: 新闻编号,栏目名称,栏目路径等。

    3)新闻信息,包括数据项:新闻编号,新闻所属栏目名称,新闻所属栏目路径,新闻标题,新闻内容,新闻图片信息,新闻审核信息等。

 4)新闻模板信息,包括数据项: 新闻模板编号,模板名称,模板内容信息等。

根据数据量的大小不同,系统可以使用不同的数据库。本系统的数据库使用的是Access数据库。Access数据库能够方便的管理,比较适合中小型网站。

本数据库共有四个表,分别为admin(管理员表),example(新闻模板表),type(新闻栏目表),article(新闻内容表)。

其中admin(管理员表) 用来记录管理员信息,example(新闻模板表)用来记录单个新闻模板信息,type(新闻栏目表)用来记录某个新闻栏目的信息,article(新闻内容表) 用来记录单条新闻信息。

图4.3管理员表

图4.4为新闻模板表

图4.5 新闻栏目表

图4.6为新闻内容表


5 系统的详细设计

5.1 程序流程图

本新闻信息系统利用程序流程图辅助编程,以减少设计中的错误,提高准确性和工作效率。

1)程序流程图的符号如图5.1所示。

图5.1 程序流程图符号

2)系统总体程序流程图如图5.2所示。

图5.2 系统总体程序流程图

5.2 系统主要功能模块

5.2.1 管理员登录功能模块

为了识别用户权限,本系统设置了登陆页面,不同权限的用户登陆后进入不同的页面,实现的功能也不一样。

本系统的登录页面如图5.3所示。

图5.3 管理员登陆界面

系统用户登录,主要是对登录用户身份进行验证,确认后,系统将根据用户身份及权限的不同将系统跳转到不同的界面。

图5.4 用户登录程序流程图

管理员登录界面验证的代码:

<!--#include file=articleconn.asp-->

<%

dim rs

UserName1=request.form("UserName")'获得登陆界面输入的用户名

PassWd1=request.form("PassWd")''获得登陆界面输入的密码

set rs=server.CreateObject("ADODB.RecordSet")'建立数据库连接

rs.open "select * from admin where UserName='" & UserName1 & "'",conn,1 '查询该用户名和密码是否存在   

if passwd1<>rs("passwd") then '当密码错误时

response.write "<link rel='stylesheet' type='text/css' href='style.css'>"

response.write "<body bgcolor='#ffffef'>"

response.write "Sorry,请输入正确的管理员名字和密码"

else '当输入的正确时进行session记录并调出mymanage.asp

session("UserName")=RS("Username")

session("KEY")=rs("OSKEY")

response.redirect "Mymanage.asp"

end if

rs.close

%>

5.2.2 用户管理功能模块

用户管理包括用户的添加和删除。

图5.5 用户管理界面

系统用户登录后主要是对登录用户身份进行验证,确认后,系统将根据用户身份及权限的不同来对用户进行管理。

图5.6 用户管理程序流程图

1)用户添加功能模块的代码:

<!--#include file="articleconn.asp"-->

<%

'判断是否正确登陆,要求是高级管理员

IF Session("KEY")<>"super"THEN

response.redirect "mymanage.asp"

response.end

END IF

%>

<%

dim rs,tsql

dim rst

'增加一个新的用户

set rst=server.CreateObject("ADODB.RecordSet")

rst.open "select * from admin",conn,3,2

rst.addnew

rst("oskey")=request("select")

rst("Username")=request("UserName2")

rst("Passwd")=request("Passwd2")

rst.update

rst.close

response.redirect "usermanage.asp"%>

2)用户删除功能模块的代码

<!--#include file="articleconn.asp"-->

<%

'判断是否正确登陆,要求是高级管理员

IF Session("KEY")<>"super"THEN

response.redirect "mymanage.asp"

response.end

END IF

%>

<%

dim rs,tsql

dim rst

typename=request("typename")

'删除此用户信息

set rst=server.CreateObject("ADODB.RecordSet")

 if request("name")="del" then

rst.open "delete * from admin where id="+request("id"),conn,1

rst.close

end if

response.redirect "usermanage.asp"

%>

5.2.3 添加新闻功能模块

添加新闻是后台管理的一个十分重要而且必不可少的功能。新闻的添加要特别注意新闻内容的添加。

图5.7 管理界面中新闻添加的界面

添加信息程序流程图如图4.8所示。

图5.8 添加信息程序流程图

添加新闻内容到数据库的代码

<!--#include file="articleconn.asp"-->

<%

function changechr(str) '将字符转换成网页能识别的字符

changechr=replace(replace(replace(replace(str,"<","<"),">",">"),chr(13),"<br>"),""," ") changechr=replace(replace(replace(replace(changechr,"[image]","<img width=516 height=389 src="),"[b]","<b>"),"[red]","<font color=CC0000>"),"[big]","<font size=7>")

changechr=replace(replace(replace(replace(changechr,"[/image]","></img>"),"[/b]","</b>"),"[/red]","</font>"),"[/big]","</font>")

end function

function makefilename(fname) '生成文件名函数

  fname = now()

  fname = replace(fname,"-","")

  fname = replace(fname," ","")

  fname = replace(fname,":","")

  fname = replace(fname,"PM","")

  fname = replace(fname,"AM","")

  fname = replace(fname,"上午","")

  fname = replace(fname,"下午","")

  makefilename=fname & ".asp"

end function

%>

<%

'判断是否正确登陆

IF not(Session("KEY")="super" or session("KEY")="check" or Session("KEY")="input") THEN

response.redirect "mymanage.asp"

response.end

END IF

'判断文章标题是否为空

if request("txttitle")="" then

response.write "错误提示:请输入文章标题!"

response.end

end if

'判断文章内容是否为空

if request("txtcontent")="" then

response.write "错误提示:请未输入文章内容!"

response.end

end if

dim title

dim content

dim sql

dim rs

dim articleid

dim classid,Nclassid

dim from

title=request("txttitle")'获取文章标题

from=request("Nfrom")'获取文章的来源

zznews=request("zznews")'获取作者信息

typeid=request("typeid")'获取栏目编号

about=request("about")'获取相关信息关键字

dim sql1

dim rs1

dim typename1

'查询此栏目编号的信息  

sql1="select * from type where typeid="&typeid

set rs1=server.createobject("adodb.recordset")

rs1.open sql1,conn,1,1

typename1=rs1("type")

filepath=rs1("typename")

'判断是否为推荐新闻

if request("checkbox1")="1" then

tjnews=1

else

tjnews=2

end if

'判断文章里时候包含图片

if request("checkbox3")="1" then

selectpic=1

else

selectpic=0

end if

'根据登陆时的不同级别,赋予shenhe不同的值  

if Session("KEY")="input" then

shenghe=2

else

if request("checkbox2")="1" then

shenghe=2

else

shenghe=1

end if

end if

'将输入框中的文章内容转换成网页格式的内容

content=changechr(request("txtcontent"))

%>

<%

'查询模板表,将选择的模板调出来

set rs = server.CreateObject("ADODB.RecordSet")

StrSql = "select E_Memo from Example where id="+request("Example")

set rs = conn.Execute (StrSql)

'生成新闻文件名

fname = makefilename(now())

dddd = year(now()) & "-" & month(now()) & "-" & day(now())

'将模板内容赋给pencat

pencat=rs("E_Memo")

'将模板中lx替换为类型名称typename1

pencat=replace(pencat,"lx",typename1)

'将模板中Data替换为实际日期dddd

pencat=replace(pencat,"Date",dddd)

if from="" then

pencat=replace(pencat,"From","www.tyust.edu.cn") '若来源为空,则将模板中的From替换为www.tyust.edu.cn

else

pencat=replace(pencat,"From",from)'若不为空,则将输入的文章来源替换模板中的From

end if

if zznews="" then

pencat=replace(pencat,"Fname","admin") '若作者为空,则将模板中的Fname替换为admin

else

pencat=replace(pencat,"Fname",zznews)'若不为空,则将输入的作者名替换模板中的Fname

end if

'将模板中H_Title替换为实际文章标题

pencat=replace(pencat,"H_Title",title)

'将模板中H_Memo替换为实际文章内容

pencat=replace(pencat,"H_Memo",content)

'将模板中labout替换为实际关键字

pencat=replace(pencat,"labout",about)

%>

<%

'将替换好的模板写进文件中

Set fso = CreateObject("Scripting.FileSystemObject")

gg=server.mappath(filepath)

Set MyFile = fso.CreateTextFile(gg&"\"&fname, True)

MyFile.WriteLine(pencat)

MyFile.Close

response.Write(gg&"\"&fname)

%>

<%

'在数据库中增加一条文章记录

set rs=server.createobject("adodb.recordset")

sql="select * from article where (newsid is null)"

rs.open sql,conn,1,3

rs.addnew

rs("title")=title

rs("path")=filepath

rs("content")=content

rs("Nfrom")=from

rs("selectpic")=selectpic

rs("typeid")=typeid

rs("typename")=typename1

rs("tjnews")=tjnews

rs("shenghe")=shenghe

rs("N_Fname")=fname

rs("zznews")=zznews

rs("about")=about

rs.update

articleid=rs("newsid")

rs1.close

set rs1=nothing

rs.close

set rs=nothing

conn.close

set conn=nothing

response.Write("ok")

%><head>

</head>

<div align="center">

<table border="0" cellspacing="1" width="50%" bgcolor="#000000"bordercolorlight="#11B1FF"

bordercolordark="#F0F8FF" cellpadding="0">

    <tr bgcolor="#000066">

      <td width="100%" height="20">

        <p align="center"><font color="#FFFFFF"><b>添加文章成功</b></font>

      </td>

    </tr>

    <tr>

      <td width="100%" bgcolor="#FFFFFF">

        <p align="left"><br>

        其文件名为:<%=fname%><br>

        文件标题为:<%response.write title%></p>

    <p align="center">是否继续添加?<br>

          <br>

    <a href="myaddarticle.asp">

    是</a>   <a href="main.asp">否</a><br>

    <br>

    </p>

        </td>

    </tr>

    </table></div>

5.2.4 新闻管理功能模块

新闻管理模块主要对新闻进行修改和删除。管理界面中新闻管理的程序流程图如下:

图5.10 管理界面中新闻管理的程序流程图

图5.9 管理界面中新闻管理的界面

新闻修改功能模块的代码

<!--#include file="articleconn.asp"-->

<%

function changechr(str) '将字符转换成网页能识别的字符

changechr=replace(replace(replace(replace(str,"<","<"),">",">"),chr(13),"<br>")," "," ")

changechr=replace(replace(replace(replace(changechr,"[image]","<img src="),"[b]","<b>"),"[red]","<font color=CC0000>"),"[big]","<font size=7>")

changechr=replace(replace(replace(replace(changechr,"[/image]","></img>"),"[/b]","</b>"),"[/red]","</font>"),"[/big]","</font>")

end function

function makefilename(fname)'生成文件名函数

  fname = now()

  fname = replace(fname,"-","")

  fname = replace(fname," ","")

  fname = replace(fname,":","")

  fname = replace(fname,"PM","")

  fname = replace(fname,"AM","")

  fname = replace(fname,"上午","")

  fname = replace(fname,"下午","")

  makefilename=fname & ".asp"

end function

%>  <%

'判断是否正确登陆

IF not(Session("KEY")="super" or session("KEY")="check" or Session("KEY")="input") THEN

response.redirect "mymanage.asp"

response.end

END IF

dim title

dim content

dim sql

dim rs

dim articleid

dim classid,Nclassid

dim from

'判断文章标题是否为空

title=request.form("txttitle")

'将输入框中的文章内容转换成网页格式的内容

content=changechr(request.form("txtcontent"))

 '获取文章编号

articleid=request("id")

dim sql1

dim rs1

dim typename1

'得到此文章编号的文章信息

 sql1="select * from article where newsid="&articleid

set rs1=server.createobject("adodb.recordset")

rs1.open sql1,conn,1,1

typename1=rs1("typename")

filepath=rs1("path")

filen=rs1("N_Fname")

'查询模板表,将选择的模板调出来

set rs = server.CreateObject("ADODB.RecordSet")

        StrSql = "select E_Memo from Example"

set rs = conn.Execute (StrSql)

'生成新闻文件名

fname = makefilename(now())

dddd = year(now()) & "-" & month(now()) & "-" & day(now())

pencat=rs("E_Memo")'将模板内容赋给pencat

pencat=replace(pencat,"Date",dddd)'将模板中Data替换为实际日期dddd

pencat=replace(pencat,"From","www.tyust.edu.cn")'将模板中From替换为www.tyust.edu.cn

pencat=replace(pencat,"Fname","网站管理员")'将模板中Fname替换为网站管理员

pencat=replace(pencat,"H_Title",title)'将模板中H_Title替换为实际文章标题title

pencat=replace(pencat,"lx",typename1)'将模板中lx替换为实际栏目名typename1

pencat=replace(pencat,"H_Memo",content)'将模板中H_Memo替换为实际内容content

'删除原来的文件

Set fso1 = CreateObject("Scripting.FileSystemObject")

fso1.DeleteFile(server.mappath(filePath& "\" & filen))

Set fso1 = nothing

'生成新文件

Set fso = Server.CreateObject("Scripting.FileSystemObject")

Set fout = fso.CreateTextFile(server.mappath(filePath& "\" & fname))

fout.WriteLine pencat

fout.close

'在数据库中增加一条文章记录

set rs=server.createobject("adodb.recordset")

sql="select * from article where newsid="&articleid

rs.open sql,conn,3,3

rs("title")=title

rs("N_Fname")=fname

rs("path")=filePath

rs("content")=content

rs.update

rs.close

set rs=nothing

conn.close

set conn=nothing

rs1.close

set rs1=nothing

response.redirect "articlemanager.asp"

%>

新闻删除功能模块的代码

<%@ LANGUAGE="VBSCRIPT" %>

<!--#include file="articleconn.asp"-->

<%

'判断是否正确登陆,要求是高级管理员

IF Session("KEY")<>"super"THEN

response.redirect "mymanage.asp"

response.end

END IF

%>

<%

   dim sql

   dim rs

   path=request("path")

   file=request("file")

   '删除数据库中此文章的信息

   set rs=server.createobject("adodb.recordset")

   sql="delete from article where newsid="&request("ID")

   rs.open sql,conn,1,1

   rs.close

   set rs=nothing  

   conn.close

   set conn=nothing

   '删除此文章对应的文件

    FiLePaTh = Server.MapPath(".")& "\" & path& "\" &file

 Set fso = CreateObject("Scripting.FileSystemObject")

 fso.DeleteFile(filepath)

    Set fso = nothing

    response.redirect "articlemanager.asp"

%>


6 测试与运行记录

6.1 测试用例设计

6.1.1 测试方案

考虑到各种因素和条件的限制,我们决定采用黑盒测试方案,再用白盒测试补充一些方案。即我们不考虑所编写程序的具体结构,而是根据软件所需要的输入数据的格式以及应该完成的功能,设计一些合法的测试用例和不合法的测试用例,特别是根据边界条件设计一些边界测试用例。

以此来检查系统是否能正确的完成预订功能,得到希望的输出。

6.1.2 测试准备

在测试前,与各模块的主要负责人共同协商讨论,以概要设计说明书.详细设计说明书作为总的提纲,选择合适的输入输出数据,并加以意义列举说明。

6.1.3 测试用例

在测试过程中,首先需要对各子单元过程进行测试。各子单元过程的测试必须先在程序设计员调试并编译通过后才能进行。在各子单元过程测试完毕后,再对各模块(包括各子单元过程之间的接口)进行测试,处理好各模块之间的接口,最后再对该系统进行必要的测试和维护。

其操作过程如下:

a.在计算机接受信息模块过程中,先对各子单元过程分别进行测试,然后根据白盒测试按照详细设计说明书中的流程图对其进行跟踪测试。

b.同样,在计算机输出信息模块、网络接受和发送模块结构和服务器模块(包括数据库)过程中先对各子单元过程分别进行测试,然后根据白盒测试法按照详细设计说明书中的流程图对其进行跟踪测试。

c.然后,根据各模块之间的各种关系,对其接口进行测试。

d.在系统测试中,要注意对各种意外情况(例如断电、硬盘损坏等)加以处理,对数据库要注意其安全性、可靠性、健壮性、效率,网络传输更要注意其安全性。

6.1.4 条件与限制

限于人手问题,参与测试的都是参与开发的人员,容易造成测试时的偏差,有些错误难以被测试出来。另外时间也是一个问题, 由于预留给测试的时间较少,最后测试比较仓促,因此对于测试用例的设计和实际测试工作的进行可能都是不够充分的。

所以我们希望本系统的测试工作能够在本次测试的基础上得以继续,将测试工作进行彻底。

6.2 测试与运行记录

6.2.1 测试管理员登录功能模块

图6.1测试管理员登录图

图6.2测试管理员登陆失败图

经测试,管理员登陆模块未出现异常,可完成其正常登陆,并可识别错误的用户名及密码。

6.2.2 测试添加新闻功能模块

图6.3 测试添加新闻图

6.2.3 测试添加文章成功模块

图6.4 测试添加文章成功图

6.2.4 测试新闻管理功能模块

图6.5 测试新闻管理修改图

6.2.5 测试用户管理功能模块

图6.6 测试添加用户

图6.7 测试添加用户成功图

6.2.6 测试新闻审核功能模块

图6.8 测试新闻审核图

图6.9 测试新闻审核成功图

本系统经过各个模块详细测试,经过修改和调整通过以后,进行了总体测试。测试结果各项功能均已经或基本达到设计要求。


结束语

    新闻信息系统是一个信息发布平台,其设计与实现均成功应用了当前成熟的信息技术、设计方法和管理概念,除了具有良好的可扩展性、可维护性和可移植性外,还具有稳定性、实用性和开发成本低等特点。

    新闻信息系统以新闻管理和发布为核心,改变了原有网站以静态页面形式发布信息质量差、效率低的状况,建成了一个基于Web的发布快捷、资源丰富、安全可靠的新闻信息系统平台,能够对信息进行集中管理与控制,进行信息的快捷有序发布,从而把信息发布提高到一个新的应用层次。

为了适应信息发布不断发展的需要,新闻信息系统还需要根据实际情况不断增加和完善功能,可以尝试融入更多的多媒体技术,如在新闻中插入FLASH等等。


致 谢

经过近四个多月的努力,我顺利完成了这篇设计。我衷心地感谢各位领导和老师对我的关心和帮助,特别是我的指导老师李默微老师,一次又一次的评阅我的设计,并提出了许多宝贵的意见和建议,使我进一步熟悉和掌握了系统开发的流程和方法,最终顺利地完成了本系统的开发。同时也感谢四年来各科任课老师的教导,您们授予的宝贵知识为我以后的学习、工作奠定了基础。感谢我的同学们四年间对我的帮助和爱护。

感谢在百忙之中参加此次评审和答辩的各位专家!


英文原文

The Exploitation Criteria And Security Management Of The ASP

Exploitation criteria :

Application servers have been, or ultimately will be used in Web server, which usually operate in the IIS ASP page computer. ASP is the only object of your client. It offers specialized systems and security considerations. While many of the Web sites use ASP simply not components, but in this article that ASP is the Internet as a bridge between the client and components. The following ASP components Guidelines (English) :

ASP and the division of services between components

ASP server in the most commonly used building for the client to use HTML or XML documents, so we focused on the use of the program. This leads to a common problem, if ASP page on the server, then they are part of the operational level? Components in the world, the answer usually is not. Although the ASP server is in operation, but may be related to space applications in the same server, but it can not make it a part of the business logic. With user interface development tool, or as the opening of more business to operational programs with the clear distinction will be tremendous returns.

Let us look at some of the most important operational level and that level division guidelines :

Separation of the UI code and business logic. This includes preparation coupled with the UI code, such as the use of ASP components MTS internal target it with the business logic code separation, as in a different DLL.

affair will be separated with the ASP page. Services ASP in certain cases beyond compare, but the components and multi-storey applications will change this situation. Components should not be dependent on the client layer to manage their affairs and business logic semantics.

Will be expressed components (use solicit and responsive components) and Web server on the same machine and / or tenor. If the use of ASP internal components of the target objects on remote machines, then all of the internal components will be available in retail form. Server client access is COM+ server, which significantly reduced the performance and security of complicated. These markings will be lay in COM+ applications mark as "library activated" .

ASP exist in server, ASP pages must be consistent with resource sharing rules, and remember to flexibility. Look at the following details :

In the "conversation", management should avoid user specific state. Keep ASP stateless and where possible to allow resources pool.

Mode operation:

In evaluating whether a code of business logic layer or expressed, may I ask myself: "If I have to use click-phone applications to replace my ASP page, then the code are there? "If the answer is" yes ", then it could try to business logic code into machine code or user interface to help.

If changed after the client code can not be used, or if it is constructed with the help of the user interface, the code is expressed services layer. It ASP page, or in the internal components used

ASP components. It does not belong to the operational targets of components. Understanding of the distinction between desktop and ASP client

It was modular incumbent engine,different table's top' tradition uniline ran win32 application from that asp. Key distinction generalize as follows: Thread management : ASP is a multi-client threads. This means that it can have many activities in the operation, perhaps at the same time dealing with different ASP page. This shows that it is not the only pseudo-objects to exclusive system users. This may be unexpected reactions, for example, into a bad habit : the object stored in ASP application variables or conversation.

Security environment : ASP is the Web site of the Internet Information Services 5.0 implementation, a low, medium, high three separate degrees. The Web site can even have different security setup, or refuse to allow anonymous access, for customer and so on. All these have generated a lot of programs, namely, the use of different end-user account is your object.

Easy rose : This is not a technical issue, but Web applications provide facilities Deputy effect. Traditionally, the increase in user base for desktop applications, the number of requests carefully planned well known to the client transferred. ASP has changed the process in motion and operational, ASP-Visual Basic applications can be conveniently opened for local or worldwide for all staff, all business partners and customers all use. This approach can be used to describe - owned super links individual e-mail users can make a tenfold increase in the base. To prepare for your applications? The only way to understand the intensity of Web sites for testing to obtain the expected value of the actual performance. Detailed information on the intensity of the test, please refer to the "application life cycle" section.

In the use of Visual Basic ASP should target? In the context of the establishment and abolition of pages of your audience. In other words, as far as possible so that no state ASP pages only in a state of dependence conversation or temporary applications variables. Not to target storage applications in English or variables. This will lock in your conversation ASP systems, the expected value of flexibility may cancel all. In other words, the Web servers handle no more than a few dozens of users. If required, in English or applications stored content, please turn it into the data rather than objects. There are many other criteria can be observed. We recommend that you read MSDN Voices, .J.D. Meier compose the column "Servin <SPAN style="mso-spacerun: yes"> </SPAN>It Up. "

The column includes a lot of technology, practice and skills development can contribute to the expansion and reliable ASP components and applications.

Not to be quoted or applications memory at conversation all the inserted object components are Visual Basic 6.0 "cell thread", that is to say they are operating in the Inter module. This means that if the thread established targets, then the object of all resources must use the same threads. Many threads (from it Web site users) use the same examples Agency targets, raises a series of activities, the application process may become bottlenecks.

In addition, in conversation with Server .Create Object stored within the object STA to be implemented threads can be effectively linked to the current user, thus it will be the largest applications to give users a few restrictions the 20xN (N = number of processors).

Mode operation:

If you according to our suggest to take object stateless, are not used for storage of a client, and stored in the context of their applications. Client will be able to establish an independent, use and cancellation of their own target. This reduces the need for maintaining conversation - because they do not retain the skills unique to the state. Recommended approach is to target a state, it needs a database or other storage area to visit (such as cookies and LDAP). If applications require the use of English or the scope of the data, the data should instead deal with the subject of data stored in it. The dispose of the you could begin one genera,came encapsulation versus desirable value.

ASP security management :

The basic concept of security management

Safety management is based on information and ASP solution to manage the security strategy has set the security level definition process. Including management of the response to violations of the security act. ASP can be controlled without fear of attack and ASP clients business continuity, so to be able to deal with malicious attacks could really an art.

Safety management in large measure dependent on the security strategy. These strategies could produce from different sources. To be considered when designing security strategy are :

Service level agreement on the definition of external customer needs external security law requires external suppliers within the ASP security strategy and security strategy in the ASP environment integrated customer circumstances, the internal / external security strategy, For each solution, ASP must be defined security strategy. The strategy should be based on the various aspects of the most reliable Hop. According to customer needs, and even the basic structure will be very different design. Usually use three safety design:

The dedicated network joint of the both  asp solution and safety precautions completeness by asp proceed end-to-end Control usually,these purport asp versus proprietary basic structure subassembly possess full control,include asp and client of compartment.

Public : ASP solutions and security measures by ASP component control. Usually, this means that within the ASP is in control of its own website, but does not guarantee to provide solutions to the public network with control. However, the ASP can be used as "virtual private network" (VPN) to carry out such technical links between ASP and client security.

Mixed : the solution is a combination of the previous two. "dedicated" and "common" solutions are used. In ensuring security solutions, and also involves ASP customers.

There are five dimensions of the process needed to improve the MOF model : planning : planning activities including in customer requirements, as well as internal and external strategies based on the legitimate demands of the SLA security component. In a dialogue with clients at the same time, it may be necessary to establish or adjust internal security strategy. Of course we should decide whether to do so by the ASP. This resulted in a level of security planning, including all aspects of the security strategy and design (infrastructure, personnel, steps, the environment, basic contracts, etc.).

Implementation : Put stratification plane execute possession necessary safety precautions,withal observe SLA suffer have definitive security part for in force. at a pinch,this phase return should put make ultra internal security policy over in force..

Assessment : Assessment is essential to end security management process. It involves determining the strategy and measures adopted by the state and effectiveness.

Maintenance : maintenance based on the following security measures on the basis of : the results of regular inspections, the risk of changes in the situation clearly, and SLA or other conditions change.

Control : control activities can organize and guide the security management process itself. Definition of a process control activities, functions, roles, responsibilities assigned, organizational structure and reporting structure. It is a continuing process and to ensure the engine improvements.

Security management process must be continuous self improvement. New solutions, new technologies, new personnel, new steps, negligence may lead to the installation of integrated security attackers solution.

ASP security configuration tool, ASP configuration tool for security managers should be very familiar with, because the system was associated with all aspects of information security, it is essential.

These tools should be very easy for you to answer the following questions : "My computer security? "or" My network security? These tools should allow for the definition of security strategy has covered all aspects of configuration and analysis, such as : account strategy. Installation or alteration visit strategies, including domain or local password strategies, domain or local domain Kerberos account lock strategy and tactics (where applicable).

Local strategy. Of the local audit strategies, a wide range of user competence and the distribution of security option, such as diskettes, CD-ROM such control. Restricted group. To be embedded in the group and the allocation of any other specific group or modify designated members of the group (such as Administrators, Server Operators, Backup Operators and Power Users, etc.). This should not be used as a management tool to use general members-only used to control specific groups (with sensitive functions assigned to them). System services. Distribution system installed in different services (including network transmission services such as TCP/IP, NetBIOS, CIFS document sharing, printing, etc.) security. If we do not use will be stopped TCP/IP outside services.


英文译文

ASP的开发准则及安全管理

ASP开发准则:

应用程序服务器通常是指为ASP页面提供IIS服务的计算机,它被应用于Web 服务器中。ASP 是唯一的客户机。它提供了专门的线程系统和安全策略。虽然许多使用 ASP 的 Web 站点根本就不用组件,但在这篇文章中假定ASP 是连接Internet 客户机和组件之间的桥梁。下面是ASP 组件准则:

ASP 和组件之间的划分服务:

ASP 最常用于在服务器上创建供客户机使用的 HTML 或 XML 文件,因此我们主要讨论这种方案的使用。这就引出了一个常见的问题:如果 ASP 页面在服务器上,那么它们是否属于应用层的一部分呢?答案通常是否。虽然 ASP 确实在服务器上运行,而且可能与同一个服务中的应用程序服务器相联系,但是这不能使它成为应用层的一部分。随着用户界面开发工具或者随着更多的应用方案的启用,将两者分离开来将获得巨大的收益。

下面是一些最重要的应用层和表示层划分准则:

分离UI 代码与应用逻辑。这包括编写与 UI 耦合的代码,例如使用 ASP 内部组件的 MTS 对象,让它与应用逻辑代码分离,如同他们是在不同的 DLL 中。

事务与 ASP 页面分离。事务 ASP 在某些情况下非常好,但是组件和多层应用程序会改变这种情况。组件不应该由客户机层来管理它们的事务和应用逻辑语义。

    将表示组件(使用请求和响应的组件)与 Web 服务器放在相同的机器和/或进程中。如果将使用 ASP 内部组件对象的对象放在远程机器上,那么对内部组件的所有调用将以回调形式发生。调用 IIS 客户机的是 COM+ 服务器,它将使性能显著降低并使安全配置复杂化。可以将这些调整对象放在标记为“库激活”的 COM+ 应用程序中。

    ASP 存在于服务器上,因此 ASP 页面必须符合资源共享规则,并且应具有可伸缩性。请看下面的详细内容:

    在“会话”中,管理应尽量避免用户使用特定的状态。保持 ASP 无状态就可以保证资源池能使用。

操作方式:

    在评价某个代码段是否属于应用逻辑或者表示层时,问一下自己,“如果我必须用按键式电话应用程序代替我的 ASP 页面,那么该代码是否还有价值?”如果答案为“是”,那么可以尝试将它划分为应用逻辑代码或者用户界面。

    如果该代码在改变了客户机后不能用,或者如果它在用户界面的帮助下才能完成,则该代码属于表示层。它在 ASP 页面中,或在使用 ASP 内部组件的组件中。它不属于应用对象组件。

理解desktop与 ASP 客户机的区别:

    ASP 是组件的特殊客户机,不同于桌面上的传统单线程 Win32 应用程序。主要区别概括如下:

    线程管理:ASP 是多线程客户机。这意味着多个活动可以并发运行,不同的 ASP 页面的处理可在同一时刻进行。于是对象不能作为唯一的使用者来独占系统。这样做可能产生不好的反应,例如说养成一个坏习惯:将对象存储在 ASP 会话或者应用程序变量中。

    安全环境:ASP 是由 Web 站点中的 Internet Information Services 5.0 执行的,有低、中、高三种隔离度。这些 Web 站点甚至可以有不同的安全设置来允许或拒绝匿名访问、验证客户等。所有这些设置产生了大量的方案,即不同的用户账户最终用的是对象。

 轻松增长:这不是技术问题,而是 Web 应用程序所提供的设施产生的附加效应。传统意义上来说,如果要为桌面应用程序增加用户基数,要求仔细计划好已知数量客户机的转出。而ASP改变了该过程的启动和运行方式,ASP-Visual Basic 应用程序可以方便地,供当地的或世界范围的所有职员、所有业务伙伴和所有客户使用。可以用这种方式来描述——拥有超链接的单个电子邮件可以使用户基数成十倍地增长。您的应用程序为此作好准备了吗?唯一了解Web 站点负担的方式是进行测试,以获得实际性能的近似值。关于强度测试的详细信息,请参阅“应用程序生命周期”一节。

在 ASP 内应该如何使用 Visual Basic 对象?在页面范围内创建和取消您的对象。也就是说,尽可能使 ASP 页面无状态,处于一种只依赖于会话或应用程序变量的状态下。不要将对象存储在会话或应用程序变量中。这将 ASP 线程锁定到您的会话、取消所有可伸缩性的预期值。也就是说,Web 服务器可处理的用户数不能超过几十个。如果需要在会话或应用程序中存储内容,请把它存为数据而不是对象。还有许多其他需要遵守的准则。我们建议您阅读 MSDN Voices 上 J. D. Meier 撰写的专栏“Servin it Up”。该专栏包括了大量的技术、实践和技巧,有助于开发可扩展的、可靠的 ASP 和组件应用程序。

 不要将引用存储在会话或应用程序中的 VB 对象中所有 Visual Basic 6.0 组件都是“单元线程”的,就是说它们都运行在 STA 单元中。这意味着如果在线程中创建对象,那么对该对象的所有调用都必须用同一线程服务。许多线程(来自Web 站点用户)使用 STA 对象的同一实例,会引起一连串的活动,有可能成为应用程序中的瓶颈。

    此外,在会话范围内存储用 Server. Create object 创建的 STA 对象,可以有效地将执行线程联系到当前用户,从而将应用程序的最大并发用户数限制到默认的 20xN(N = 处理器数量)。

操作方式 :

 如果您按照我们的建议使对象无状态,则不需要存储引用以供客户机复用,并可在应用程序范围内存储它们。客户机将能够独立创建、使用和取消它们自己的对象。这就减少了保持会话特有对象的需要的资源,原因是它们不保留会话特有的状态。推荐的方式是使对象无状态,它在需要时访问数据库或其他存储区(例如 cookies 和 LDAP)。如果需要使用会话或应用程序范围的数据,请将数据而不是处理数据的对象,存储在此。您可以创建一个类,来封装对所需值的处理。

ASP安全管理:

ASP安全管理的基本概念

安全管理是根据对信息和 ASP 解决方案安全策略中的设定来管理已定义的安全级别的过程。其中包括管理对违反安全行为的处理。可以控制攻击而不用担心 ASP 以及 ASP 客户业务的持续性,能够这样来对付恶意方的攻击可真是一门艺术。

安全管理在很大程度上依赖于安全策略。这些策略可从不同来源中产生。设计安全性时要考虑的策略有:

    服务级别协议中定义的外部客户需求;

    关于安全的外部法律要求;

    外部供应商安全策略;

    内部ASP 安全策略;

    在 ASP 和客户环境的集成情况下,内部/外部的安全策略。

    对于每个解决方案,ASP 必须定义安全策略。该策略应是基于上述各个方面的最可靠的综合。

    根据客户的需求,即使是基本结构的设计也会很不相同。通常使用三种安全设计:

    专用:ASP 解决方案和安全措施完全由 ASP 进行端对端的控制。通常,这意味着 ASP 对所有的基本结构组件具有完全的控制,包括 ASP 和客户之间的专用网络连接。

    公用:ASP 解决方案和安全措施由 ASP 部分控制。通常,这意味着 ASP 对自己的站点具有控制权,但是不保证它对用来提供解决方案的公用网络具有控制权。然而,ASP 可使用像“虚拟专用网络”(VPN) 这样的技术来进行 ASP 和客户安全之间的技术性的连接。

    混合:该解决方案是前面两种的结合。在确定安全的解决方案和ASP客户时,它同时使用了“专用”和“公用”解决方案。

该过程有五个层面需要对 MOF 模型进行改进:

    规划:规划活动包括客户要求、内部和外部策略以及在合法要求的条件上建立 SLA 安全部件的方式。在与客户进行实时对话时,可能有必要确定或调整内部安全策略。当然要由 ASP 来决定是否这样做。这样做的结果是产生一个的安全规划的层次,其中包括安全策略和所有方面的设计(如基本结构、人员、步骤、环境、基础合同等等)。

    实施:实施层面执行所有必要的安全措施,以实现 SLA 中已经定义的安全部分。必要时,此阶段还将实施更改过的内部安全策略。

评估:评估是结束安全管理过程所必不可少的。它涉及所采用措施和所确定策略的状态和有效性。

    维护:安全措施的维护建立在以下方面的基础上:定期检查的结果、对状况变化的风险的评估,以及 SLA 或其它条件的更改。

    控制:控制活动可组织并指导安全管理过程本身。控制活动定义子进程、功能、角色、责任分配、组织结构和报告结构。它是过程的引擎并确保进行持续的改进。 安全管理过程必须不断地进行自我改良。新解决方案、新技术、新人员、新步骤、疏忽都可能导致攻击者攻破所安装的安全解决方案。

ASP 的安全配置工具

ASP 管理员应当对安全配置工具非常熟悉,因为如果要获得系统中与安全相关的所有方面的信息,这是必不可少的。

这些工具使您非常容易地回答以下问题:“我的计算机安全吗?”,或者“我的网络安全吗?”。这些工具应当允许对已定义的安全策略所包含的所有方面进行配置和分析,例如:

    账号策略。 设置或更改访问策略,包括域或本地密码策略、域或本地账户锁定策略以及域 Kerberos 策略(在适用情况下)。

    本地策略。 配置本地审核策略、用户权限分配和各式各样的安全选项,例如对软盘、CD-ROM 等的控制。

    受限制的组。 对内置的组以及要进行配置的任何其它特定组指定或更改组成员(如 Administrators、Server Operators、Backup Operators、Power Users 等)。这不应作为一个用一般的成员管理工具来控制特定组(具有指定给他们的敏感功能)的成员。

    系统服务。 配置安装在系统上不同服务(包括网络传输服务如 TCP/IP、NetBIOS、CIFS 文件共享、打印等)的安全性。如果不使用,则会停止 TCP/IP的外部服务。 


参考文献

[1]张海潘.软件工程导论[M].北京:清华大学出版社,2003年.

[2]胡崧.网站建设实例大制作[M].北京:中国青年出版社,2007年.

[3]王珊.数据库系统概论[M].北京:中国人民大学出版社,2003年.

[4]高怡新.ASP网络应用程序设计(第2版) [M].北京:人民邮电出版社,2008年.

[5]李存珠,李宣东.软件工程概论[M].南京:南京大学计算机系出版,2001年.

[6]杨志株.ASP+SQL Serve基础练习+典型案例[M].清华大学出版社,2006年.

[7]Jackson MA.Principles of Program Design[M].Oxford:Academic Press,1975年.

[8]Stephen R.Schach.Sotware Engineering with java[M].北京:机械工业出版社,1999年.

[9]郭瑞军,初晓璐,汪志亮.ASP数据库开发实例精粹[M].北京:电子工业出版社,2007年.

[10] 陈益材,李睦芳. Dreamweaver CS3+ASP动态网站开发从基础到实践[M].北京:机械工业出版社,2008年.

[11]启明工作室.ASP网络开发从入门到精通[M].北京:人民邮电出版社,2007年.

[12]孔璐,袁珏,吴志坚,顾洪.数据库应用开发综合实例教程[M].国防工业出版社,2008年.

[13]赛奎春.ACCESS开发实例解析[M].北京:机械工业出版社,2006年.

[14]郑世珏,杨青.数据库技术与应用基础教程[M].北京:高等教育出版社,2005年.

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

等天晴i

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值