|
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
|
FormsAuthentication.RedirectFromLoginPage Método (String, Boolean)
Assembly: System.Web (em System.Web. dll)
public static void RedirectFromLoginPage( string userName, bool createPersistentCookie )
Parâmetros
- userName
- Tipo: System.String
Login do usuário autenticado.
- createPersistentCookie
- Tipo: System.Boolean
true to create a durable cookie (one that is saved across browser sessions); otherwise, false.
| Exceção | Condição |
|---|---|
| HttpException |
Observação de segurança: |
|---|
Observação de segurança: |
|---|
<%@ Page Language= %>
<%@ Import Namespace= %>
<!DOCTYPE html PUBLIC "-
"http:
<script runat=>
Login_OnClick(object sender, EventArgs args)
{
(Membership.ValidateUser(UsernameTextbox.Text, PasswordTextbox.Text))
FormsAuthentication.RedirectFromLoginPage(UsernameTextbox.Text, NotPublicCheckBox.Checked);
Msg.Text = ;
}
</script>
<html xmlns="http:
<head>
<title>Login</title>
</head>
<body>
<form id= runat=>
<h3>Login</h3>
<asp:Label id= ForeColor= runat= /><br />
Username: <asp:Textbox id= runat= /><br />
Password: <asp:Textbox id= runat= TextMode= /><br />
<asp:Button id= Text= OnClick= runat= />
<asp:CheckBox id= runat= />
Check here <span style=>not</span> a computer.
</form>
</body>
</html>
Observação de segurança: