%@ Language=VBScript %> <% '判断用户是否提交表单 if isempty(Request.Form("Login")) then Session.abandon Session("NumAttempts") = 1 TheMessage = "用户名为学号,初始密码为姓名首字母!提示:初次登陆后请及时修改密码!" '校验用户提交的用户信息 else set conn = server.createobject ("adodb.connection") conn.open "AspAcess", "", "" TheUsername=Request.Form("Username") ThePassword=Request.Form("Password") If Instr(TheUsername, "'")=0 and Instr(ThePassword, "'")=0 and Instr(TheUsername, "'")=0 _ and Instr(ThePassword, "'")=0 then set RSLogin = conn.Execute("select * from student where " & "stdid = '" _ & TheUsername & "' and " & "Password = '" & ThePassword & "'") if RSLogin.EOF then Session("NumAttempts") = Session("NumAttempts") + 1 if Application("NumAttempts") = 0 then TheMessage = "登录不成功,用户名或密码不正确,请重试!:):" elseif Session("NumAttempts") > Application("NumAttempts") then TheMessage = "登录不成功,用户名或密码不正确,无法重试" else TheTimes=Application("NumAttempts")-Session("NumAttempts")+1 TheMessage = "登录不成功,还有" & TheTimes & "次机会,请重试:" end if else lessonsid=RSLogin("LessonId") Session("stdid") = RSLogin("stdid") Session("classid")=RSLogin("classid") Session("Name")=RSLogin("Name") Session("Password")=RSLogin("Password") Session("lessonid")=RSLogin("LessonId") if lessonsid=1 then Response.Redirect "./index/DK_INDEX.htm" elseif lessonsid=2 then Response.Redirect "./index/JD_INDEX.htm" elseif lessonsid=3 then Response.Redirect "./index/HX_INDEX.htm" elseif lessonsid=4 then Response.Redirect "./index/YX_INDEX.htm" elseif lessonsid=5 then Response.Redirect "./index/INDEX.htm" end if end if else TheMessage=Session("输入不正确,请重新输入!") end if end if %>
|
|
|
|
|
|
|
|
|
|
CopyRight Reserved By 安徽理工大学图书馆信息咨询部
Email:tsgzx@aust.edu.cn 2004-5-5