|
<%
Dim MasterName,MasterPW
Dim ActionTxt
MasterName="admin" '管理员账号
MasterPW="888000" '管理员密码
ActionTxt=Request.QueryString("action")
Select Case ActionTxt
Case "LoginForm"
Call LoginForm
Case "Login"
Call Login
Case "UserList"
Call UserList
Case "DelO"
Call DelO
Case Else
Call LoginForm
End Select
Sub LoginForm
Response.Write("<div style='width:200px; font-size:12px; text-align:left; margin-top:100px; padding:30px 35px 10px 70px; border:1px #FF0000 solid;'>")
Response.Write("<form name='LogForm' action='Admin.asp?action=Login' method='post'>")
Response.Write("<div style='padding-left:30px; font-weight:bold;'>-= 管理登陆 =-</div><br>")
Response.Write("账 号:<input type='text' name='U_Name' style='width:100px;' /><br>")
Response.Write("密 码:<input type='password' name='mima' style='width:65px;' /><br><br>")
Response.Write("<div style='padding-left:50px;'><input type='submit' name='submit' value='登陆管理' /></div>")
Response.Write("</form>")
Response.Write("</div>")
End Sub
Sub Login
Dim M_Name,M_PW
M_Name=Trim(Request.Form("U_Name"))
M_PW=Trim(Request.Form("mima"))
If M_Name=MasterName And M_PW=MasterPW Then
Session("MasterLogin")=M_Name
Call UserList
Else
Response.Write("管理帐号或密码错误!")
End If
End Sub
Sub CheckLogin
If IsNull(Session("MasterLogin")) or Session("MasterLogin")="" Then
Response.Write("请先登陆!")
Response.End()
End If
End Sub
Sub UserList
Dim conn,Str,Rs
Call CheckLogin '验证是否登陆
Set conn=Server.CreateObject("adodb.Connection")
Str= "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath("DB/DataBase.mdb")
conn.Open Str
Set Rs=conn.execute("Select * From [Login] ORDER BY KeyID DESC")
If not Rs.bof And not Rs.eof Then
Response.Write("<table width='600' border='1' cellpadding='2' cellspacing='0'>")
Response.Write("<tr style='font-weight:bold;'>")
Response.Write("<td width='20%'>用户名</td>")
Response.Write("<td width='15%'>验证码</td>")
Response.Write("<td width='20%'>登陆IP</td>")
Response.Write("<td width='25%'>注册时间</td>")
Response.Write("<td width='20%'>操作</td>")
Response.Write("</tr>")
Do While not Rs.eof
Response.Write("<tr>")
Response.Write("<td>"&Rs("UserName")&"</td>")
Response.Write("<td>"&Rs("PassWord")&"</td>")
Response.Write("<td>"&Rs("IPaddress")&"</td>")
Response.Write("<td>"&Rs("AddTime")&"</td>")
Response.Write("<td><a href='Admin.asp?action=DelO&RID="&Rs("KeyID")&"'>删除</a></td>")
Response.Write("</tr>")
Rs.MoveNext
Loop
Response.Write("</table>")
Else
Response.Write("暂无任何信息!")
End If
Rs.Close
Response.Write("<div style='width:600px; text-align:right; margin-top:30px;'><a href='Admin.asp?action=Logout'>退出登陆</a></div>")
End Sub
Sub DelO
Dim conn,Str,Rs,RecordID
Call CheckLogin '验证是否登陆
RecordID=Request.QueryString("RID")
Set conn=Server.CreateObject("adodb.Connection")
Str= "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath("DB/DataBase.mdb")
conn.Open Str
conn.execute("Delete * From [Login] Where KeyID="&RecordID)
Response.Write("<script language=JavaScript>alert('删除成功!');location.href='Admin.asp?action=UserList';</script>")
End Sub
Sub Logout
Session("MasterLogin")=""
Session("MasterLogin")=Nothing
Response.Write("退出成功!")
End Sub
%>
那位大虾能帮我把里面的ASP账号密码代码取出!!
其余的不要!!谢谢了!! |
|