SimpleMembershipProvider.CreateAccount Method (String, String, Boolean)
Creates a new user account by using the specified user name and password.
Assembly: WebMatrix.WebData (in WebMatrix.WebData.dll)
'Declaration Public Overrides Function CreateAccount ( _ userName As String, _ password As String, _ requireConfirmationToken As Boolean _ ) As String 'Usage Dim instance As SimpleMembershipProvider Dim userName As String Dim password As String Dim requireConfirmationToken As Boolean Dim returnValue As String returnValue = instance.CreateAccount(userName, _ password, requireConfirmationToken)
- Type: System.String
The user name.
- Type: System.String
- Type: System.Boolean
(Optional) true to specify that the user account must be confirmed; otherwise, false. The default is false.
Return ValueType: System.String
A token that can be sent to the user to confirm the user account.
username is empty.
username already has a user account.
password is empty.
password is longer than 128 characters.
A user record that corresponds to username does not exist in the UserTableName table (the user profile table).
The database operation failed.
A user account is an entry in the membership table (by default, webpages_Membership). A user account record includes information such as the date that the account was created, the password, the date and time when the password was most recently changed, and so on. The user account table does not contain the user's name or email address; that information is stored instead in a user profile table. When you call the method, a user record that has the same user name (email address) as the account that you are trying to create must exist in the user profile table.
If the user profile record does not already exist and you want to create the user profile record and the membership account record at the same time, call CreateUserAndAccount(String, String, Boolean, IDictionary(Of String, Object)).
The token that this method returns can be sent to the user as part of a hyperlink that points to a confirmation page in your site. In the confirmation page, you can read the token and call the ConfirmAccount(String) method in order to confirm the account.