0

In the following method which comes from MembershipUser class

public override MembershipUser CreateUser(string username, string password, 
                                          string email,
                                          string passwordQuestion,
                                          string passwordAnswer, bool isApproved, 
                                          object providerUserKey,
                                          out MembershipCreateStatus status)

can anyone explain me what are following for?

 bool isApproved, object providerUserKey, out MembershipCreateStatus status

I looked up at the following site from microsoft msdn but I couldn't understand properly.

4

1 回答 1

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如果您希望创建一个无法登录的用户,您可以传递给该方法。

查看 MembershipCreateStatus的文档,您可以看到这将返回各种不同的错误消息,详细说明用户创建失败(或成功)的原因。

至于providerUserKey,这应该是一个唯一标识用户的值,例如整数 id。

于 2013-06-10T15:09:13.480 回答