下面就是满足你设想的几个主程序,你还可以在实际应用中不断完善和扩充: login.asp ' 考生验证 <%@ Language=VBScript%> <% name=trim(request("name")) passwd=trim(request("passwd")) if name<>"" and passwd<>"" then ' 检查考生是否输入用户名和密码 Set conn = Server.CreateObject("ADODB.Connection") conn.Open "driver={Microsoft Access Driver(*.mdb)}; dbq="& Server.MapPat("exercise.mdb") set rs= server.createobject("adodb.recordset") sql= "select * from user where user= '" &name&"' and passwd='" & passwd &"'" Set rs= conn.Execute(sql) ' 验证考生合法性 if not(rs.eof) then if rs("score")<>0 then ' 检查考生是否已参加过考试,若是则进行成绩查询 response.write rs("user")&"的考试成绩是"&rs("score") else session("pass")=1 session("user")=name response.redirect "test.asp" end if else Response.Write "噢,您输入的用户名或密码不正确!" end if else end if %> >