用ASP检查MDAEMON系统管理员登录
类别: ASP教程
<%
Set oMDUser = Server.CreateObject("MDUserCom.MDUser")
Set oMDUserInfo = Server.CreateObject("MDUserCom.MDUserInfo")
oMDUser.LoadUserDll
cAppDir = oMDUser.GetAppDir
Dim aDomains()
Dim iTotalAccounts
Dim iTotalDomains
iTotalDomains = oMDUser.GetDomainCount
iTotalAccounts = oMDUser.UserCount
Redim aDomains(0,iTotalDomains)
oMDUser.GetDomainNames(aDomains)
If Request.Form("cmdLogin") = "Add" Then
sLogin = Request.Form("txtUserName")
sPassword = Request.Form("txtPassword")
iUserID = oMDUser.GetByEmail(sLogin)
If iUserID = -1 Then
sMessage = "无此用户"
End If
If iUserID <> 1 Then
sMessage = "权限不够,请用系统管理员登录"
Else
If sPassword = oMDUser.GetPassword(iUserID) Then
Session("MDUsers") = sLogin
oMDUser.GetFree iUserID
sMessage = "正确登录"
Else
sMessage = "口令错误"
End If
End If
End If
%>
管理员登录示例!
<FORM ACTION="login.asp" METHOD=post ID="Form1">
<TABLE ID="Table1">
<TR><TD>Domain:</TD><TD><INPUT SIZE=50 NAME="txtDomain" ID="Text1"></TD></TR>
<TR><TD>User name:</TD><TD><INPUT SIZE=25 NAME="txtUserName" ID="Text3"></TD></TR>
<TR><TD>Password:</TD><TD><INPUT TYPE="password" SIZE=25 NAME="txtPassword" ID="Password1"></TD></TR>
<TR><TD></TD><TD><INPUT TYPE="submit" value="Add" NAME="cmdLogin" ID="Submit1"></TD></TR>
</TABLE>
<%=sMessage%>
</FORM>
Set oMDUser = Server.CreateObject("MDUserCom.MDUser")
Set oMDUserInfo = Server.CreateObject("MDUserCom.MDUserInfo")
oMDUser.LoadUserDll
cAppDir = oMDUser.GetAppDir
Dim aDomains()
Dim iTotalAccounts
Dim iTotalDomains
iTotalDomains = oMDUser.GetDomainCount
iTotalAccounts = oMDUser.UserCount
Redim aDomains(0,iTotalDomains)
oMDUser.GetDomainNames(aDomains)
If Request.Form("cmdLogin") = "Add" Then
sLogin = Request.Form("txtUserName")
sPassword = Request.Form("txtPassword")
iUserID = oMDUser.GetByEmail(sLogin)
If iUserID = -1 Then
sMessage = "无此用户"
End If
If iUserID <> 1 Then
sMessage = "权限不够,请用系统管理员登录"
Else
If sPassword = oMDUser.GetPassword(iUserID) Then
Session("MDUsers") = sLogin
oMDUser.GetFree iUserID
sMessage = "正确登录"
Else
sMessage = "口令错误"
End If
End If
End If
%>
管理员登录示例!
<FORM ACTION="login.asp" METHOD=post ID="Form1">
<TABLE ID="Table1">
<TR><TD>Domain:</TD><TD><INPUT SIZE=50 NAME="txtDomain" ID="Text1"></TD></TR>
<TR><TD>User name:</TD><TD><INPUT SIZE=25 NAME="txtUserName" ID="Text3"></TD></TR>
<TR><TD>Password:</TD><TD><INPUT TYPE="password" SIZE=25 NAME="txtPassword" ID="Password1"></TD></TR>
<TR><TD></TD><TD><INPUT TYPE="submit" value="Add" NAME="cmdLogin" ID="Submit1"></TD></TR>
</TABLE>
<%=sMessage%>
</FORM>
- 上一篇: 处理图片、文章的程序
- 下一篇: 在线修改SERV-U 4.2用户密码
-= 资 源 教 程 =-
文 章 搜 索