Adds a new membership user to the data source.
Namespace:
System.Web.Security
Assembly:
System.Web (in System.Web.dll)
Visual Basic (Declaration)
Public MustOverride Function CreateUser ( _
username As String, _
password As String, _
email As String, _
passwordQuestion As String, _
passwordAnswer As String, _
isApproved As Boolean, _
providerUserKey As Object, _
<OutAttribute> ByRef status As MembershipCreateStatus _
) As MembershipUser
Dim instance As MembershipProvider
Dim username As String
Dim password As String
Dim email As String
Dim passwordQuestion As String
Dim passwordAnswer As String
Dim isApproved As Boolean
Dim providerUserKey As Object
Dim status As MembershipCreateStatus
Dim returnValue As MembershipUser
returnValue = instance.CreateUser(username, _
password, email, passwordQuestion, _
passwordAnswer, isApproved, providerUserKey, _
status)
public abstract MembershipUser CreateUser(
string username,
string password,
string email,
string passwordQuestion,
string passwordAnswer,
bool isApproved,
Object providerUserKey,
out MembershipCreateStatus status
)
public:
virtual MembershipUser^ CreateUser(
String^ username,
String^ password,
String^ email,
String^ passwordQuestion,
String^ passwordAnswer,
bool isApproved,
Object^ providerUserKey,
[OutAttribute] MembershipCreateStatus% status
) abstract
public abstract function CreateUser(
username : String,
password : String,
email : String,
passwordQuestion : String,
passwordAnswer : String,
isApproved : boolean,
providerUserKey : Object,
status : MembershipCreateStatus
) : MembershipUser
Takes, as input, the name of a new user, a password, and an e-mail address and inserts a new user for the application into the data source. The CreateUser method returns a MembershipUser object populated with the information for the newly created user. The CreateUser method also defines an out parameter (in Visual Basic, you can use ByRef) that returns a MembershipCreateStatus value that indicates that the user was successfully created, or a reason that user creation failed.
The CreateUser method raises the ValidatingPassword event, if a MembershipValidatePasswordEventHandler event handler has been specified, and continues or cancels the create-user action based on the results of the event. You can use the OnValidatingPassword virtual method to execute the specified MembershipValidatePasswordEventHandler event handler.
For an example of a MembershipProvider implementation, see Implementing a Profile Provider.
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
.NET Framework
Supported in: 3.5, 3.0, 2.0
Reference
Other Resources