⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 login.asp

📁 该资料包含大量网络开发的案例和源代码
💻 ASP
字号:
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>登录</title>
<meta name="Microsoft Border" content="b, default">
</head>

<body><!--msnavigation--><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><!--msnavigation--><td valign="top">
<%
	dim adoConn,adoRS,sConnection,sSQL
    dim user,Uname,psw
    
    user=request("User")
    psw=trim(cstr(request("Psw")))  
  	
    set adoConn=server.createobject("ADODB.Connection")
    set adoRS=server.createobject("ADODB.Recordset")
    sConnection="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.mappath("student.mdb")   
    adoConn.open sConnection
	
	if user="" or psw="" then
		response.write "用户或密码为空,请重新登录!"
		session("user")=""
	else
		sSQL="select sno,sn,psw from s where sno="& user &" and psw='"& psw&"'" 	
    	set adoRS=adoConn.execute(sSQL)
		if adoRS.bof and adoRs.eof then		
			response.write "无此用户或密码错误,请重新登录!"
			session("user")=""
		else
			session("user")=user
			session("uname")=adoRS(1)
			session("psw")=psw
			response.redirect("index.asp")
		end if
		adoRS.close
		set adoRS=nothing
	end if	
	
    adoConn.close    
    set adoConn=nothing
%>	
<p align="center"><a href="index.asp">返回主页</a></p>
<!--msnavigation--></td></tr><!--msnavigation--></table><!--msnavigation--><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td>

<p align="center"><font color="#333333" size="2">版权所有|关于我们</font>

</td></tr><!--msnavigation--></table></body>

</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -