<%@ Language=VBScript %>
<!-- METADATA TYPE="TypeLib" UUID="{01E88D14-F479-4CA5-9CA8-EBD2EED74C83}" -->
<HTML>
<BODY>
<H1 align=center>在線注冊演示</H1>
<%
Dim sMessage
If Request.Form("cmdAddUser") <> "" Then
Dim oMDUser
Dim oMDUserInfo
Dim nResult
Dim sFullName
Dim sUserName
Dim sPassword
sFullName = Request.Form("txtFullName")
sUserName = Request.Form("txtUserName")
sPassword = Request.Form("txtPassword")
sDomain=Request.Form("txtDomain")
Set oMDUser = Server.CreateObject("MDUserCOM.MDUser")
Set oMDUserInfo = Server.CreateObject("MDUserCOM.MDUserInfo")
If oMDUser.LoadUserDll() = True Then
oMDUser.InitUserInfo(oMDUserInfo)
oMDUserInfo.FullName = sFullName
oMDUserInfo.MailBox = sUserName
oMDUserInfo.Password = sPassword
oMDUserInfo.Domain = sDomain
oMDUser.FilterUserInfo (oMDUserInfo)
nResult = oMDUser.AddUser (oMDUserInfo)
Select Case nResult
Case MDDLLERR_NOERROR
sMessage = "用戶注冊成功!"
Case MDDLLERR_USEREXISTS
sMessage = "用戶名: '" & sUserName & "' 已存在!注冊失敗!"
case Else
sMessage = "注冊用戶失敗 ! 錯誤代碼:" & nResult
End Select
oMDUser.FreeUserDll
Else
sMessage = "錯誤: 不能加載DLL文件"
End If
Set oMDUser = Nothing
Set oMDUserInfo = Nothing
End If
%>
<P>新用戶注冊</P>
<FORM ACTION="adduser.asp" METHOD=post ID="Form1">
<TABLE ID="Table1">
<TR><TD>域名:</TD><TD><INPUT SIZE=50 NAME="txtDomain" ID="Text1" value="system.mail" readonly></TD></TR>
<TR><TD>全名:</TD><TD><INPUT SIZE=50 NAME="txtFullName" ID="Text2"></TD></TR>
<TR><TD>登錄名:</TD><TD><INPUT SIZE=25 NAME="txtUserName" ID="Text3"></TD></TR>
<TR><TD>口令:</TD><TD><INPUT TYPE="password" SIZE=25 NAME="txtPassword" ID="Password1"></TD></TR>
<TR><TD></TD><TD><INPUT TYPE="submit" value="注冊新用戶" NAME="cmdAddUser" ID="Submit1"></TD></TR>
</TABLE>
</FORM>
<%
Response.Write(sMessage & "<BR>")
%>
</BODY>
</HTML>