|
Este artículo proviene de un motor de traducción automática. Mueva el puntero sobre las frases del artículo para ver el texto original. Más información.
|
Traducción
Original
|
Membership (Clase)
Espacio de nombres: System.Web.Security
Ensamblado: System.Web (en System.Web.dll)
El tipo Membership expone los siguientes miembros.
| Nombre | Descripción | |
|---|---|---|
![]() ![]() | ApplicationName | |
![]() ![]() | EnablePasswordReset | |
![]() ![]() | EnablePasswordRetrieval | |
![]() ![]() | HashAlgorithmType | |
![]() ![]() | MaxInvalidPasswordAttempts | |
![]() ![]() | MinRequiredNonAlphanumericCharacters | |
![]() ![]() | MinRequiredPasswordLength | |
![]() ![]() | PasswordAttemptWindow | |
![]() ![]() | PasswordStrengthRegularExpression | |
![]() ![]() | Provider | |
![]() ![]() | Providers | |
![]() ![]() | RequiresQuestionAndAnswer | |
![]() ![]() | UserIsOnlineTimeWindow |
| Nombre | Descripción | |
|---|---|---|
![]() ![]() | CreateUser(String, String) | |
![]() ![]() | CreateUser(String, String, String) | |
![]() ![]() | CreateUser(String, String, String, String, String, Boolean, MembershipCreateStatus) | |
![]() ![]() | CreateUser(String, String, String, String, String, Boolean, Object, MembershipCreateStatus) | |
![]() ![]() | DeleteUser(String) | |
![]() ![]() | DeleteUser(String, Boolean) | |
![]() ![]() | FindUsersByEmail(String) | |
![]() ![]() | FindUsersByEmail(String, Int32, Int32, Int32) | |
![]() ![]() | FindUsersByName(String) | |
![]() ![]() | FindUsersByName(String, Int32, Int32, Int32) | |
![]() ![]() | GeneratePassword | |
![]() ![]() | GetAllUsers() | |
![]() ![]() | GetAllUsers(Int32, Int32, Int32) | |
![]() ![]() | GetNumberOfUsersOnline | |
![]() ![]() | GetUser() | |
![]() ![]() | GetUser(Boolean) | |
![]() ![]() | GetUser(Object) | |
![]() ![]() | GetUser(String) | |
![]() ![]() | GetUser(Object, Boolean) | |
![]() ![]() | GetUser(String, Boolean) | |
![]() ![]() | GetUserNameByEmail | |
![]() ![]() | UpdateUser | |
![]() ![]() | ValidateUser |
| Nombre | Descripción | |
|---|---|---|
![]() ![]() | ValidatingPassword |
Nota |
|---|
Crear nuevos usuarios. Almacenar la información de pertenencia (nombres de usuario, contraseñas, direcciones de correo electrónico y datos compatibles) en Microsoft SQL Server o en un almacén de datos alternativo. Autenticar a los usuarios que visitan el sitio. Mediante programación puede autenticar a los usuarios o puede utilizar el control Login para crear un sistema de autenticación completo que requiere poco o ningún código. Administrar contraseñas que incluyen su creación, cambio, recuperación y restablecimiento, etc. Opcionalmente puede configurar la pertenencia a ASP.NET para que requiera una pregunta y una respuesta de contraseña para autenticar las peticiones de restablecimiento o recuperación de la contraseña para aquellos usuarios que la hayan olvidado.
<configuration>
<connectionStrings>
<add name="SqlServices" connectionString="Data Source=AspSqlServer;Integrated Security=SSPI;Initial Catalog=aspnetdb;" />
</connectionStrings>
<system.web>
<membership defaultProvider="SqlProvider" userIsOnlineTimeWindow="20">
<providers>
<remove name="AspNetSqlProvider" />
<add name="SqlProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="SqlServices"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
passwordFormat="Hashed"
applicationName="/" />
</providers>
</membership>
</system.web>
</configuration>
| Topic | Location |
|---|---|
| Tutorial: Crear un sitio Web con suscripción e inicio de sesión de usuarios (Visual Studio) | Generar aplicaciones Web ASP .NET en Visual Studio |
| Tutorial: Crear un sitio web con pertenencia e inicio de sesión de usuarios | Generar aplicaciones con Visual Web Developer |
Nota |
|---|
Nota sobre la seguridad |
|---|
<%@ Page Language="C#" %> <%@ Import Namespace="System.Web.Security" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> public void Login_OnClick(object sender, EventArgs args) { if (Membership.ValidateUser(UsernameTextbox.Text, PasswordTextbox.Text)) FormsAuthentication.RedirectFromLoginPage(UsernameTextbox.Text, NotPublicCheckBox.Checked); else Msg.Text = "Login failed. Please check your user name and password and try again."; } </script> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <title>Login</title> </head> <body> <form id="form1" runat="server"> <h3>Login</h3> <asp:Label id="Msg" ForeColor="maroon" runat="server" /><br /> Username: <asp:Textbox id="UsernameTextbox" runat="server" /><br /> Password: <asp:Textbox id="PasswordTextbox" runat="server" TextMode="Password" /><br /> <asp:Button id="LoginButton" Text="Login" OnClick="Login_OnClick" runat="server" /> <asp:CheckBox id="NotPublicCheckBox" runat="server" /> Check here if this is <span style="text-decoration:underline">not</span> a public computer. </form> </body> </html>
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (no se admite el rol Server Core), Windows Server 2008 R2 (se admite el rol Server Core con SP1 o versiones posteriores; no se admite Itanium)
.NET Framework no admite todas las versiones de todas las plataformas. Para obtener una lista de las versiones compatibles, vea Requisitos de sistema de .NET Framework.
