文档管理项目
下面总结项目总用到的知识
1、登录
此次项目是采用xml文件的形式存储管理员密码,进行登录和修改密码操作
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
<?xml version="1.0" encoding="utf-8"?> <Users> <FirstUser userName="zhangsan" userPwd="111111" /> </Users>
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
//读取user.xml文件 string path = Server.MapPath("~/Areas/Admin/Xml/user.xml"); XmlDocument document = new XmlDocument(); document.Load(path); XmlNode rootNode = document.DocumentElement; XmlNode firstNode = rootNode.FirstChild; string userName = firstNode.Attributes["userName"].Value.Trim(); string userPwd = firstNode.Attributes["userPwd"].Value.Trim();
使用了YZMHelper产生验证码
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
YZMHelper y = new YZMHelper(); //创建验证码 y.CreateImage(); //获取验证码文本 TempData["Yzm"] = y.Text; //将验证码保存到指定路径下 System.Drawing.Bitmap b = y.Image; b.Save(path, System.Drawing.Imaging.ImageFormat.Png);
2、统计报表
使用的是DotNet.Highcharts报表插件
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
Highcharts chart = new Highcharts("mychart") .SetTitle(new Title() { Text = "每一年项目的总金额" }) .SetSubtitle(new Subtitle() { Text = "数据来源:项目文档管理系统" }) .SetSeries(new Series() { Type=DotNet.Highcharts.Enums.ChartTypes.Line,Name = "项目总金额", Data = new DotNet.Highcharts.Helpers.Data(moneyList.ToArray())}) .SetXAxis(new XAxis() { Categories = yearList.ToArray()}) .SetYAxis(new YAxis() { }) .SetCredits(new Credits() { Enabled = false }) .SetLegend(new Legend() { Layout = DotNet.Highcharts.Enums.Layouts.Vertical, Align = DotNet.Highcharts.Enums.HorizontalAligns.Right, VerticalAlign=DotNet.Highcharts.Enums.VerticalAligns.Top });
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
@model DotNet.Highcharts.Highcharts@{ ViewBag.Title = ""; Layout = "~/Areas/Admin/Views/Shared/_LayoutPage.cshtml"; } <script src="/Scripts/jquery-1.4.4.js" type="text/javascript"></script> <script src="/Scripts/highcharts.js" type="text/javascript"></script> <div id="container" style="min-width:700px;height:400px"> @(Model) </div>
3、缓存的使用
数据库存在时
首先建立数据库缓存依赖
比如:(直接在cmd下运行)
@echo off "C:\Program Files\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" aspnet_regsql -S localhost -E -ed -d ProjectManageDB -et -t TblProjectInfo
然后在web.config中的<system.web> </system.web>中加入如下代码
<caching> <sqlCacheDependency> <databases> <!--connectionStringName:连接数据库的连接字符串,name:数据库名称--> <add connectionStringName="ProjectManageDBConnectionString" name="ProjectManageDB" pollTime="2000"/> </databases> </sqlCacheDependency> </caching>
接着使用CacheHelper的Add方法添加缓存即可
CacheHelper.Add(key, projectList,"ProjectManageDB","TblProjectInfo");
4、webservice
5、ckplayer
。。。。。