ASP.NET 登陆3次之后提示秘密不对并且退出窗体
protected void Lbtn_Click( object sender, EventArgs e )
{
string userName = this.TextUserName.Text;
string userPwd = this.TextPwd.Text;
userPwd = this.TextNPwd.Text;
userTable = BLLuser.GetData( );
if ( userTable != null && userTable.Rows.Count >= 1 )
{
if ( TextUserName.Text.Trim( ) == userTable.Rows[ 0 ][ "UserName" ].ToString( ) &&
TextPwd.Text.Trim( ) == userTable.Rows[ 0 ][ "UserPwd" ].ToString( ) )
{
Response.Redirect( "Default.aspx" );
}
else
{
logFailCount++;
if ( logFailCount >= 3 )
{
Response.Write( "<script> window.opener=null;window.close(); </script>" );
}
else
Response.Write( "密码不对" );
}
}
}