第二章 系统实现 下面给出系统开发出来的详细界面以阐述公司内部管理系统的具体功能。 paper51.com 2.1数据库连接 http://www.paper51.com 代码如下: http://www.paper51.com <% 内容来自www.paper51.com dimconn '数据库连接 copyright paper51.com dimconnstr '连接字符串 paper51.com dim db '数据库文件路径 http://www.paper51.com db ="Database/office.mdb" '演示时用ACCESS数据库 paper51.com connstr= "Provider = Microsoft.Jet.OLEDB.4.0;Data Source = " &Server.MapPath(db) copyright paper51.com Setconn = Server.CreateObject("ADODB.Connection") copyright paper51.com
if errThen paper51.com err.clear 内容来自论文无忧网 www.paper51.com end if http://www.paper51.com conn.Openconnstr paper51.com '关闭数据库连接,在每页中调用此函数,将连接放入连接池 paper51.com
subCloseConn() http://www.paper51.com conn.Close() paper51.com Setconn = Nothing paper51.com end sub paper51.com '替换单引号 http://www.paper51.com functionRealString(strSrc) 内容来自www.paper51.com RealString = Replace(Trim(strSrc), "'", "''") 内容来自www.paper51.com endfunction paper51.com
%> paper51.com 2.2登陆界面设计 内容来自www.paper51.com 首先是进入登陆界面,本窗体显示用户名称,密码校验等信息,本系统的用户分为三类:系统管理员,财务管理员,普通员工。使用者可以输入相应的用户名和密码,单击“确定”就会将输入提交给系统以验证用户、密码及身份。如果用户名及密码正确,则会进入系统的主体。 内容来自论文无忧网 www.paper51.com 本模块的流程图如下: paper51.com
内容来自www.paper51.com
copyright paper51.com
paper51.com
内容来自www.paper51.com 代码如下: 内容来自论文无忧网 www.paper51.com '校验用户提交的用户信息 paper51.com
else paper51.com TheUsername=Request.Form("Username") 内容来自论文无忧网 www.paper51.com ThePassword=Request.Form("Password") 内容来自www.paper51.com
If Instr(TheUsername, "'")=0 andInstr(ThePassword, "'")=0 and Instr(TheUsername, "'")=0 _ copyright paper51.com and Instr(ThePassword, "'")=0then 内容来自www.paper51.com
set RSLogin = conn.Execute("select *from PSLogins where " & "LoginID = '" _ 内容来自www.paper51.com & TheUsername & "' and " & "Password ='" & ThePassword & "'") 内容来自论文无忧网 www.paper51.com if RSLogin.EOF then 内容来自www.paper51.com
Session("NumAttempts") =Session("NumAttempts") + 1 内容来自论文无忧网 www.paper51.com if Application("NumAttempts") = 0then http://www.paper51.com TheMessage = "登录不成功,请重试:" http://www.paper51.com elseif Session("NumAttempts")> Application("NumAttempts") then copyright paper51.com TheMessage = "登录不成功,登录次数已满,无法重试" copyright paper51.com else http://www.paper51.com TheTimes=Application("NumAttempts")-Session("NumAttempts")+1 http://www.paper51.com
TheMessage = "登录不成功,还有" & TheTimes & "次机会,请重试:" copyright paper51.com end if 内容来自论文无忧网 www.paper51.com
else 内容来自www.paper51.com Session("ID") = RSLogin("LoginID") 内容来自论文无忧网 www.paper51.com Application("ID")= RSLogin("LoginID") 内容来自www.paper51.com Session("Name")= RSLogin("Name") copyright paper51.com Session("Password")= RSLogin("Password") copyright paper51.com
Session("Department")= RSLogin("Department") 内容来自www.paper51.com Session("EmailAddress")=RSLogin("EmailAddress") 内容来自论文无忧网 www.paper51.com Session("Position")=RSLogin("Position") copyright paper51.com Session("InternalPhone")=RSLogin("InternalPhone") paper51.com
Session("HomePhone")=RSLogin("HomePhone") copyright paper51.com Session("MobilePhone")=RSLogin("MobilePhone") http://www.paper51.com
Session("QQ")=RSLogin("QQ") 内容来自www.paper51.com Session("Birthday")=RSLogin("Birthday") 内容来自论文无忧网 www.paper51.com Session("HomeAddress")=RSLogin("HomeAddress") http://www.paper51.com Session("IsSystemManager")=RSLogin("IsSystemManager") paper51.com Session("IsFinancialManager")=RSLogin("IsFinancialManager") 内容来自论文无忧网 www.paper51.com Response.Redirect"home.asp" 内容来自论文无忧网 www.paper51.com
end if 内容来自www.paper51.com else copyright paper51.com
TheMessage="用户名或者密码输入不合格式" copyright paper51.com end if paper51.com end if copyright paper51.com <% response.write TheMessage %> 内容来自论文无忧网 www.paper51.com
<div align="center"> http://www.paper51.com <% paper51.com if TheMessage <> "登录不成功,登录次数已满,无法重试" then paper51.com %> http://www.paper51.com <form name="form"method="post" action="index.asp"> paper51.com
<p><fontcolor="#3466BB">用户</font> 内容来自www.paper51.com <input class=itm name=UserNamesize=15> 内容来自www.paper51.com </p> 内容来自www.paper51.com <p><fontcolor="#3466BB">密码</font> 内容来自论文无忧网 www.paper51.com <input class=itm name=Password size=15type=password> http://www.paper51.com <br> http://www.paper51.com <br> paper51.com
<input type="submit"name="Login" value="登录"style="border: 1px solid #B6CAEB; background-color: #3466BB; color:#FFFFFF"> http://www.paper51.com <input type="reset"name="Reset" value="重设"style="border: 1px solid #B6CAEB; background-color: #3466BB; color:#FFFFFF"> 内容来自www.paper51.com |