Using ASP to create MDaemon user's code _ Application technique

Source: Internet
Author: User
<%@ Language=vbscript%>
<!--METADATA type= "TypeLib" uuid= "{01e88d14-f479-4ca5-9ca8-ebd2eed74c83}"-->
<HTML>
<BODY>
&LT;H1 align=center> Online Registration Demo </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 = "User Registration successful!"
Case Mddllerr_userexists
smessage = "Username: '" & sUserName & "' already exists! Registration failed! "
Case Else
smessage = "Registered user failed!" Error code: "& Nresult
End Select

Omduser.freeuserdll
Else
smessage = "Error: DLL file cannot be loaded"
End If
Set Omduser = Nothing
Set Omduserinfo = Nothing
End If
%>

<P> New User Registration </P>
<form action= "adduser.asp" Method=post id= "Form1" >
<table id= "Table1" >
<TR><TD> domain: </td><td><input size=50 name= "Txtdomain" id= "Text1" value= "System.mail" Readonly></td></tr>
<TR><TD> Full Name: </td><td><input size=50 name= "Txtfullname" id= "Text2" ></td></tr >
<TR><TD> Login 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= "register new user" Name= "cmdadduser" ID= "Submit1" > </TD></TR>
</TABLE>
</FORM>
<%
Response.Write (smessage & "<BR>")
%>
</BODY>
</HTML>
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.