A preserved archive of the Logical Gamers community forums, 2009-2025. The original threads and posts, served read-only. Registration, posting and private messages are gone for good.

[C#] Advanced Password Protection

1.1k views · started by Chad ·
#1
[C#] Advanced Password Protection
Still not recommended. Got extremely bored.


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace AP
{
public partial class frmMain : Form
{
int IntNum = 0;
int IntWait = 60;

public frmMain()
{
InitializeComponent();
}

private void cmdCheck_Click(object sender, EventArgs e)
{
if (txtPassword.Text == "Password")
{
MessageBox.Show("Welcome!", "Success");
}
else if (IntNum >= 5)
{
MessageBox.Show ("You have been blocked for to many failed login attempts!","Blocked");
tmrBlock.Enabled = true;
IntNum = 0;
cmdCheck.Enabled = false;
txtPassword.Enabled = false;
}
else
{
MessageBox.Show("Password incorrect!", "Error");
IntNum = IntNum + 1;
}

}

private void tmrBlock_Tick(object sender, EventArgs e)
{
IntWait = IntWait - 1;

if (IntWait <= 0)
{
cmdCheck.Enabled = true;
txtPassword.Enabled = true;
tmrBlock.Enabled = false;
MessageBox.Show ("Please try again!","Unblocked");
}
}
}
}
#2
A+ I needed this for my flp admin panel i will give you credits thanks ^^