这段代码的含义是什么 [英] what is the meaning of this code

查看:104
本文介绍了这段代码的含义是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从互联网上获取此代码,但我无法理解下面代码的含义。

请注明此代码的含义...



i got this code from internet but i cant understand the meaning of below code.
please give the meaning of this code ...

if (rows == -1) rows = registered.Count();
         int pageSize = rows ?? 2;

推荐答案

创建用户是会员类中的一个功能

和会员资格可以是对象那个类



模型可以是模型层中的属性我的意思是特定的类。
Create User is a Function in Membership class
and Membership can be the object of that class

model can be the property in the model layer i mean the specific class.


Hey Anand,



我认为你正在研究MVC。它没有将数据插入表中,实际上它正在检查用户的真实性。



成员资格是一个类,CreateUser是一个对象。 model表示将在其中创建这些属性的模型: - UserName,Password和Email。



所以它将这些属性与提供的值相关联用户。



如果发现用户是真实的,则会显示他的帐户/状态。
Hey Anand,

I think you are working on MVC. It's not inserting the data into the table, actually it's checking the authenticity of user.

Membership is a class and CreateUser is an object. "model" is representing your model in which these properties would be created :- "UserName, Password and Email".

so it's associating those properties with the value provided by the user.

If the user is found to be authentic then his account/status would be shown.


添加新的具有指定属性值和数据存储的唯一标识符的用户,并返回指示用户已成功创建的状态参数或用户创建失败的原因。
Adds a new user with specified property values and a unique identifier to the data store and returns a status parameter indicating that the user was successfully created or the reason the user creation failed.
public static MembershipUser CreateUser(
    string username,
    string password,
    string email,
    string passwordQuestion,
    string passwordAnswer,
    bool isApproved,
    Object providerUserKey,
    out MembershipCreateStatus status
)





参数

usernameType:System .String



新用户的用户名。

passwordType:System.String



新用户的密码。

emailType:System.String



新用户的电子邮件地址。

passwordQuestionType:System.String



会员用户的密码问题值。

passwordAnswerType: System.String



会员用户的密码答案值。

isApprovedType:System.Boolean



一个布尔值,指示新用户是否被批准登录。

providerUserKeyType:System.Object



用户标识符对于应存储在会员数据存储中的用户。

statusType:System.Web.Security.MembershipCreateStatus



MembershipCreateStatus表示用户创建成功或原因创建失败。





返回值

类型:System.Web .Security.MembershipUser

新创建的用户的MembershipUser对象。如果没有创建用户,则此方法返回null。





Parameters
usernameType: System.String

The user name for the new user.
passwordType: System.String

The password for the new user.
emailType: System.String

The e-mail address for the new user.
passwordQuestionType: System.String

The password-question value for the membership user.
passwordAnswerType: System.String

The password-answer value for the membership user.
isApprovedType: System.Boolean

A Boolean that indicates whether the new user is approved to log on.
providerUserKeyType: System.Object

The user identifier for the user that should be stored in the membership data store.
statusType: System.Web.Security.MembershipCreateStatus

A MembershipCreateStatus indicating that the user was created successfully or the reason creation failed.


Return Value
Type: System.Web.Security.MembershipUser
A MembershipUser object for the newly created user. If no user was created, this method returns null.

CreateUser adds a new user to the data store and returns a MembershipUser object for the newly created user. If the user creation fails, you can retrieve a MembershipCreateStatus value from the status output parameter that indicates why user creation failed. You can specify a unique identifier for the user, such as a primary key value for a database, by using the providerUserKey parameter.

The CreateUser method will return null if password is an empty string or null, username is an empty string or null or contains a comma (,), passwordQuestion is not null and contains an empty string, or passwordAnswer is not null and contains an empty string.


这篇关于这段代码的含义是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆