以下方法来自MembershipUser类
public override MembershipUser CreateUser(string username, string password,
string email,
string passwordQuestion,
string passwordAnswer, bool isApproved,
object providerUserKey,
out MembershipCreateStatus status)
任何人都可以解释我的追随者吗?
bool isApproved, object providerUserKey, out MembershipCreateStatus status
我从微软msdn查看了以下网站,但我无法理解。
答案 0 :(得分:0)
从该文件:
isApproved
Type: System.Boolean
A Boolean that indicates whether the new user is approved to log on.
providerUserKey
Type: System.Object
The user identifier for the user that should be stored in the membership data store.
status
Type: System.Web.Security.MembershipCreateStatus
A MembershipCreateStatus indicating that the user was created successfully or the reason creation failed.
对我来说这似乎很简单。如果您希望在无法登录的情况下创建用户,则可以将isApproved: false
传递给该方法。
查看documentation for MembershipCreateStatus,您会看到这将返回各种不同的错误消息,指明用户创建失败(或成功)的确切原因。
对于providerUserKey
,这应该是唯一标识用户的值,例如整数id。