知识库管理系统
XX学院信息科学与工程学院数据结构课程设计
题目:知识库管理系统
学生姓名:
学号:
专业:计算机科学与技术
班级:XX级(X)班
指导教师姓名及职称:
起止时间:20** 年3 月——20** 年6 月
一、需求分析
1.1课题背景及意义
知识库管理系统软件将来自工作中、生活中、培训中、组织内的各类资料和领域知识进行管理维护并提供关联分析和综合查询服务。
系统是一个b/s结构的底层服务软件,其中的服务端均部署在服务器上后台运行,并提供配置web管理界面,以达到知识辅助管理的目的。
1.2课题要求
知识库管理系统包括文件集中存储上传、文档链接、关联文档、规则使用、智能检索等主要功能。
文件集中存储上传:支持文件的批量上传及压缩包导入,支持Office文档、PDF、图像、音视频和图纸等各类型文件。
文档链接:支持将文档发送至常用文档,用户无需每次在打开各个目录中查找;支持将文档发送至目录,方便其他用户查阅;
关联文档:文档新建或上传后,系统会自动或手动为文件生成唯一编号,支持文档的批量关联。
支持通过文件唯一编号,实现文档与相关文档、图纸、图片及其它格式附件进行关联,点击链接即可一键快速查看。系统支持为图片、音、视频类文件增加摘要及缩略图。
规则使用:系统支持为文件设定规则,指定动作(组合)、条件和操作,当动作触发符合设定的条件,系统则自动执行规则的操作。
智能检索:快速从海量资料中精准检索所需文件,可根据依据文件类型、文件关键信息、时间等,也可在完成检索操作后对信息进行接受、判断、提取、分析和概括之后形成自己的知识,然后保存,成为下一次分析、概括的依据和基础。可以直接在系统中预览各类格式的图片、播放视频、音频以及浏览各类Office文件,包括Word、Excel、PowerPoint、WPS、Visio等格式
.
1.3设计目标
(1)名称:知识库管理系统
(2)Web主页:https://www.360docs.net/doc/ab9734289.html,
(3)开发工具、搭建环境:visual studio 2015,windows server 2012R,sql server 2008。
(4)运行环境:IE,chrome,firefox,opera
(5)Web特点:
1.图形化且易于导航,具有同一页可以显示丰富的色彩,图形和文本的功能。
2.提供将图形,音频,视频信息集合于一体的特征。
3.与平台无关,无论什么系统,只要通过Internet访问www。
4. Web是分布式的,使在物理上并不一定在一个站点的信息在逻辑上一体化,从用户来看
这些信息是一体的。
5. Web是动态的,经常更新内容信息。
6. Web是交互的,主要表现在超链接,另外通过FORM的形式可以从服务器
方获得动态的信息。用户通过填写FORM可以向服务器提交请求,服务器可
以根据用户的请求返回相应信息。
(6)功能:文件上传,文件检索,文件下载,系统简介
二、概要设计
2.1 问题解决的思路概述
首先是确定了系统设计的流程图,选定较成熟的bootstrap https://www.360docs.net/doc/ab9734289.html, sql server技术进行开发,利用已经存在的数据结构和函数方法来构造系统的结构,接着把系统实现分为3个步骤:数据库的设计,前台页面的设计,后台程序逻辑的设计。
2.2 前端界面介绍说明
前端界面运用的目前很成熟的bootstrap框架,可以快速搭建系统的前端页面。该系统总共有7个页面(index.html about.html viewer.html lib_flieList.aspx lib_upload.aspx login.aspx video.aspx)
2.3 主要程序函数调用说明
三、详细设计
3.1 用户注册和登录
{
}
protected void btnupload_Click(object sender, EventArgs e)
{
if (upfile.HasFile)
{
int uplength = 10;
int muplength = 45;
string filename = Session["login"]+"-"+upfile.FileName;
string fileExtension = System.IO.Path.GetExtension(upfile.FileName).ToLower();
if (fileExtension == ".xls" || fileExtension == ".xlsx" || fileExtension == ".pdf" || fileExtension == ".doc" || fileExtension == ".docx")
{
string upload_file = Server.MapPath(File_PATH_Text) + Session["login"]+"-" +
upfile.FileName;
string upload_file2 = "/Files/Text/" + Session["login"]+"-" + upfile.FileName;
if (!File.Exists(upload_file))
{
if (upfile.FileBytes.Length / (1024 * 1024) > uplength)
{
ClientScript.RegisterStartupScript(this.GetType(), "uploadok", "alert('大小超出" + uplength + "M的限制!');", true);
return;
}
try
{
SqlParameter[] paras = {
new SqlParameter("@name",filename),
new SqlParameter("@path",upload_file2),
new SqlParameter("@intro",txtIntro.Text.ToString()),
new SqlParameter("@uid",Session["id"].ToString()),
};
if (SqlHelper.ExecuteNonQuery(SqlHelper.GetConnSting(DB_APP), CommandType.Text, "insert into
FilePath(file_id,file_name,file_path,file_intro,file_ML,is_collect,upload_time,usr_id,is_share)
values( newid(),@name,@path,@intro,'文档','未收藏',getdate(),@uid,'分享')", paras) > 0)
{
upfile.PostedFile.SaveAs(upload_file);
if (fileExtension == ".doc" || fileExtension == ".docx")
{
Document doc = new Document(upload_file);
Aspose.Words.Saving.PdfSaveOptions savaOptions = new
Aspose.Words.Saving.PdfSaveOptions();
https://www.360docs.net/doc/ab9734289.html,pliance = PdfCompliance.PdfA1a;
doc.Save(upload_file.Replace(upload_file.Substring(upload_https://www.360docs.net/doc/ab9734289.html,stIndexOf(".") + 1), "pdf"));
}
else if (fileExtension == ".xls" || fileExtension == ".xlsx")
{
Workbook workbook = new Workbook(upload_file);
workbook.Save(upload_file.Replace(upload_file.Substring(upload_https://www.360docs.net/doc/ab9734289.html,stIndexOf(".") + 1), "pdf"),
Aspose.Cells.SaveFormat.Pdf);
}
ClientScript.RegisterStartupScript(this.GetType(), "uploadok", "alert('提示:文件上传成功');", true);
}
}
catch (Exception ex)
{
ClientScript.RegisterStartupScript(this.GetType(), "uploadok", "alert('提示:文件上传失败" + ex.Message + "');", true);
throw;
}
}
else
{
ClientScript.RegisterStartupScript(this.GetType(), "uploadok", "alert('提示:文件已经存在,请重新命名上传');", true);
}
}
else if (fileExtension == ".mp3" || fileExtension == ".mp4" || fileExtension == ".jpeg" || fileExtension == ".jpg" || fileExtension == ".png")
{
string upload_file = Server.MapPath(File_PATH_Media) + Session["login"]+"-" +
upfile.FileName;
string upload_file2 = "Files/Media/" + Session["login"] +"-"+ upfile.FileName;
if (!File.Exists(upload_file))
{
if (upfile.FileBytes.Length / (1024 * 1024) > muplength)
{
ClientScript.RegisterStartupScript(this.GetType(), "uploadok", "alert('大小超出" + muplength + "M的限制!');", true);
return;
}
try
{
SqlParameter[] paras = {
new SqlParameter("@name",filename),
new SqlParameter("@path",upload_file2),
new SqlParameter("@intro",txtIntro.Text.ToString()),
new SqlParameter("@uid",Session["id"].ToString())
};
if (SqlHelper.ExecuteNonQuery(SqlHelper.GetConnSting(DB_APP), CommandType.Text, "insert into
FilePath(file_id,file_name,file_path,file_intro,file_ML,is_collect,upload_time,usr_id,is_share)
values( newid(),@name,@path,@intro,'媒体','未收藏',getdate(),@uid,'分享')", paras) > 0)
{
upfile.PostedFile.SaveAs(upload_file);
ClientScript.RegisterStartupScript(this.GetType(), "uploadok", "alert('提示:文件上传成功');", true);
}
}
catch (Exception ex)
{
ClientScript.RegisterStartupScript(this.GetType(), "uploadok", "alert('提示:文件上传失败" + ex.Message + "');", true);
throw;
}
}
else
{
ClientScript.RegisterStartupScript(this.GetType(), "uploadok", "alert('提示:文件已经存在,请重新命名上传');", true);
}
}
else
{
Response.Write("");
}
}
else
{
ClientScript.RegisterStartupScript(this.GetType(), "uploadok", "alert('请选择上传文件!')", true);
}
}
protected void exit_Click(object sender, EventArgs e)
{
Session.Clear();
Response.Redirect("index.html");
}
}
}
3.3 文档列表
前台页面:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="lib_flieList.aspx.cs" Inherits= "datastruct.lib_flieList" %>
function Enter(buttonname) {
if (event.keyCode == 13) {
event.keyCode = 9;
event.returnValue = false;
document.all[buttonname].click();
}
};
/* reset webkit search input browser style */
input {
margin: 5px auto;
outline: none;
}
input[type=search] {
-webkit-appearance: textfield;
-webkit-box-sizing: content-box;
font-family: inherit;
font-size: 100%;
}
input::-webkit-search-decoration,
input::-webkit-search-cancel-button {
display: none; /* remove the search and cancel icon */
}
/* search input field */
input[type=search] {
background: #ededed url(res/photo/search-icon.png) no-repeat 9px center;
border: solid 1px #ccc;
padding: 9px 10px 9px 32px;
width: 55px;
-webkit-border-radius: 10em;
-moz-border-radius: 10em;
border-radius: 10em;
-webkit-transition: all .5s;
-moz-transition: all .5s;
transition: all .5s;
}
input[type=search]:focus {
width: 130px;
background-color: #fff;
border-color: #6dcff6;
-webkit-box-shadow: 0 0 5px rgba(109,207,246,.5);
-moz-box-shadow: 0 0 5px rgba(109,207,246,.5);
box-shadow: 0 0 5px rgba(109,207,246,.5);
}
/* placeholder */
input:-moz-placeholder {
color: #999;
}
input::-webkit-input-placeholder {
color: #999;
}