private void buttonCheck_Click(object sender, EventArgs e)
{
int[] ModPassword = { 1, 1, 1, 1, 1};
int DerIndex;
Random rnd = new Random();
ModiPassword.ResetText();
string PasswordUser = BoxPassword.Text;
if (PasswordUser.Length >= 10)
{
ResultCheck1.ResetText();
ResultCheck1.ForeColor = System.Drawing.Color.Green;
ResultCheck1.Text += "Enough Charakters;";
}
else
{
ResultCheck1.ResetText();
ResultCheck1.ForeColor = System.Drawing.Color.Red;
ResultCheck1.Text += " Not enough Charakters;";
ModPassword[0]++;
}
if (PasswordUser.Any(char.IsUpper))
{
ResultCheck2.ResetText();
ResultCheck2.ForeColor = System.Drawing.Color.Green;
ResultCheck2.Text += "Capital Letter(s);";
}
else
{
ResultCheck2.ResetText();
ResultCheck2.ForeColor = System.Drawing.Color.Red;
ResultCheck2.Text += "Has no Capital Letter(s);";
ModPassword[1]++;
}
if (PasswordUser.Any(char.IsLower))
{
ResultCheck3.ResetText();
ResultCheck3.ForeColor = System.Drawing.Color.Green;
ResultCheck3.Text += "Low Letter(s)";
}
else
{
ResultCheck3.ResetText();
ResultCheck3.ForeColor = System.Drawing.Color.Red;
ResultCheck3.Text += "Has no low Letter(s)";
ModPassword[2]++;
}
if (PasswordUser.Any(char.IsDigit))
{
ResultCheck4.ResetText();
ResultCheck4.ForeColor = System.Drawing.Color.Green;
ResultCheck4.Text += "Has a Number(s)";
}
else
{
ResultCheck4.ResetText();
ResultCheck4.ForeColor = System.Drawing.Color.Red;
ResultCheck4.Text += "Has no Number(s)";
ModPassword[3]++;
}
if (PasswordUser.Contains("!"))
{
ResultCheck5.ResetText();
ResultCheck5.ForeColor = System.Drawing.Color.Green;
ResultCheck5.Text += "Has a !";
}
else
{
ResultCheck5.ResetText();
ResultCheck5.ForeColor = System.Drawing.Color.Red;
ResultCheck5.Text += "Has no !";
ModPassword[4]++;
}
string newPsw = PasswordUser;
string newPsw2 = "";
string newPsw3 = "";
string newPsw4 = "";
string newPsw5 = "";
string newPsw6 = "";
string newPsw7 = "";
string newPsw8 = "";
string newPsw9 = "";
string newPsw10 = "";
string newPassword = "";
string Number = "";
int count = 0;
for (int i = 0; i < ModPassword.Length; i++)
{
if (ModPassword == 2)
{
DerIndex = i;
switch (i)
{
case 0:
Guid B = Guid.NewGuid();
string GuidStrings = Convert.ToBase64String(B.ToByteArray());
GuidStrings = GuidStrings.Replace("=", "");
GuidStrings = GuidStrings.Replace("+", "");
newPassword = PasswordUser + GuidStrings;
break;
case 1:
int numUps1 = rnd.Next(1, 11);
int numUps2 = rnd.Next(1, numUps1);
for (i