|
Este artigo foi traduzido por máquina. Coloque o ponteiro do mouse sobre as frases do artigo para ver o texto original. Mais informações.
|
Tradução
Original
|
Método Roles.DeleteCookie
Assembly: System.Web (em System.Web.dll)
| Exceção | Condição |
|---|---|
| System.Configuration.Provider.ProviderException |
Observação de segurança: |
|---|
<%@ 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"> publicvoid Login_OnClick(object sender, EventArgs args) { if (Membership.ValidateUser(UsernameTextbox.Text, PasswordTextbox.Text)) { Roles.DeleteCookie(); FormsAuthentication.RedirectFromLoginPage(UsernameTextbox.Text, NotPublicCheckbox.Checked); } else Msg.Text = "User authentication failed. Please check your username 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 ifthisis <span style="text-decoration:underline">not</span> a public computer </form> </body> </html>
Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
o.NET Framework e.NET Compact Framework não oferecem suporte a todas as versões de cada plataforma. Para obter uma lista de versões suportadas, consulte Requisitos de sistema do .NET framework.
Observação de segurança: