67 lines
1.7 KiB
C#
67 lines
1.7 KiB
C#
|
|
using RapierCommand1;
|
|||
|
|
using System;
|
|||
|
|
using System.IO;
|
|||
|
|
using System.Windows.Forms;
|
|||
|
|
|
|||
|
|
namespace HDIPMk2Streaming
|
|||
|
|
{
|
|||
|
|
public partial class PasswordForm : Form
|
|||
|
|
{
|
|||
|
|
private int PasswordTries = 0;
|
|||
|
|
|
|||
|
|
public PasswordForm()
|
|||
|
|
{
|
|||
|
|
InitializeComponent();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void textBox1_KeyDown(object sender, KeyEventArgs e)
|
|||
|
|
{
|
|||
|
|
if (e.KeyValue == 13)
|
|||
|
|
{
|
|||
|
|
BtnEnter_Click(sender, e);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void BtnEnter_Click(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
if (TxBxPassword.Text == "VeniVidiVici")
|
|||
|
|
{
|
|||
|
|
frmRapierCmd.CorrectPassword = true;
|
|||
|
|
|
|||
|
|
using (StreamWriter AL = File.AppendText($"{frmRapierCmd.TxtFileDir}ActivityLog.txt"))
|
|||
|
|
{
|
|||
|
|
AL.WriteLine("Advanced Menu Opened " + Convert.ToString(DateTime.Now));
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
Close();
|
|||
|
|
}
|
|||
|
|
else if (TxBxPassword.Text == "Ebbsfleet2012")
|
|||
|
|
{
|
|||
|
|
frmRapierCmd.CorrectPassword = true;
|
|||
|
|
frmRapierCmd.MAVCopy = true;
|
|||
|
|
Close();
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
PasswordTries++;
|
|||
|
|
BtnEnter.Text = "Incorrect " + PasswordTries;
|
|||
|
|
|
|||
|
|
using (StreamWriter AL = File.AppendText($"{frmRapierCmd.TxtFileDir}ActivityLog.txt"))
|
|||
|
|
{
|
|||
|
|
AL.WriteLine("Incorrect password " + Convert.ToString(DateTime.Now));
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if (PasswordTries > 2)
|
|||
|
|
{
|
|||
|
|
Application.Restart();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void BtnCancel_Click(object sender, EventArgs e)
|
|||
|
|
{
|
|||
|
|
Close();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|