mirror of
https://github.com/Crypto-Notepad/Crypto-Notepad.git
synced 2026-03-11 08:55:25 +00:00
Value of the variable was changed
This commit is contained in:
parent
6681cda2c9
commit
b77fe02a0f
1 changed files with 17 additions and 14 deletions
|
|
@ -20,7 +20,7 @@ public partial class MainWindow : Form
|
||||||
string filename = "Unnamed.cnp";
|
string filename = "Unnamed.cnp";
|
||||||
string[] args = Environment.GetCommandLineArgs();
|
string[] args = Environment.GetCommandLineArgs();
|
||||||
int caretPos = 0;
|
int caretPos = 0;
|
||||||
string appName = Assembly.GetExecutingAssembly().GetName().Name;
|
string appName = Assembly.GetExecutingAssembly().GetName().Name + " – ";
|
||||||
|
|
||||||
public MainWindow()
|
public MainWindow()
|
||||||
{
|
{
|
||||||
|
|
@ -83,7 +83,7 @@ void DecryptAES()
|
||||||
string de = AES.Decrypt(opnfile, publicVar.encryptionKey, ps.TheSalt, ps.HashAlgorithm, ps.PasswordIterations, "16CHARSLONG12345", ps.KeySize);
|
string de = AES.Decrypt(opnfile, publicVar.encryptionKey, ps.TheSalt, ps.HashAlgorithm, ps.PasswordIterations, "16CHARSLONG12345", ps.KeySize);
|
||||||
customRTB.Text = de;
|
customRTB.Text = de;
|
||||||
|
|
||||||
this.Text = appName + " - " + NameWithotPath;
|
this.Text = appName + NameWithotPath;
|
||||||
filename = OpenFile.FileName;
|
filename = OpenFile.FileName;
|
||||||
|
|
||||||
string cc2 = customRTB.Text.Length.ToString(CultureInfo.InvariantCulture);
|
string cc2 = customRTB.Text.Length.ToString(CultureInfo.InvariantCulture);
|
||||||
|
|
@ -111,7 +111,7 @@ private void openToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
string opnfile = File.ReadAllText(OpenFile.FileName);
|
string opnfile = File.ReadAllText(OpenFile.FileName);
|
||||||
string NameWithotPath = Path.GetFileName(OpenFile.FileName);
|
string NameWithotPath = Path.GetFileName(OpenFile.FileName);
|
||||||
customRTB.Text = opnfile;
|
customRTB.Text = opnfile;
|
||||||
this.Text = appName + " - " + NameWithotPath;
|
this.Text = appName + NameWithotPath;
|
||||||
string cc2 = customRTB.Text.Length.ToString(CultureInfo.InvariantCulture);
|
string cc2 = customRTB.Text.Length.ToString(CultureInfo.InvariantCulture);
|
||||||
customRTB.Select(Convert.ToInt32(cc2), 0);
|
customRTB.Select(Convert.ToInt32(cc2), 0);
|
||||||
return;
|
return;
|
||||||
|
|
@ -142,7 +142,7 @@ private void openAsotiations()
|
||||||
string de = AES.Decrypt(opnfile, publicVar.encryptionKey, ps.TheSalt, ps.HashAlgorithm, ps.PasswordIterations, "16CHARSLONG12345", ps.KeySize);
|
string de = AES.Decrypt(opnfile, publicVar.encryptionKey, ps.TheSalt, ps.HashAlgorithm, ps.PasswordIterations, "16CHARSLONG12345", ps.KeySize);
|
||||||
customRTB.Text = de;
|
customRTB.Text = de;
|
||||||
|
|
||||||
this.Text = appName + " - " + NameWithotPath;
|
this.Text = appName + NameWithotPath;
|
||||||
|
|
||||||
filename = args[1];
|
filename = args[1];
|
||||||
string cc = customRTB.Text.Length.ToString(CultureInfo.InvariantCulture);
|
string cc = customRTB.Text.Length.ToString(CultureInfo.InvariantCulture);
|
||||||
|
|
@ -180,7 +180,7 @@ private void newToolStripMenuItem_Click_1(object sender, EventArgs e)
|
||||||
customRTB.Clear();
|
customRTB.Clear();
|
||||||
StreamWriter sw = new StreamWriter(SaveFile.FileName);
|
StreamWriter sw = new StreamWriter(SaveFile.FileName);
|
||||||
string NameWithotPath = Path.GetFileName(SaveFile.FileName);
|
string NameWithotPath = Path.GetFileName(SaveFile.FileName);
|
||||||
this.Text = appName + " - " + NameWithotPath;
|
this.Text = appName + NameWithotPath;
|
||||||
filename = SaveFile.FileName;
|
filename = SaveFile.FileName;
|
||||||
sw.Close();
|
sw.Close();
|
||||||
}
|
}
|
||||||
|
|
@ -490,10 +490,13 @@ private void deleteFileToolStripMenuItem_Click_1(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
File.Delete(filename);
|
File.Delete(filename);
|
||||||
customRTB.Clear();
|
customRTB.Clear();
|
||||||
publicVar.encryptionKey = "";
|
publicVar.encryptionKey = "";
|
||||||
|
pictureBox6.Enabled = false;
|
||||||
|
pictureBox7.Enabled = false;
|
||||||
pictureBox11.Enabled = false;
|
pictureBox11.Enabled = false;
|
||||||
|
pictureBox13.Enabled = false;
|
||||||
filename = "Unnamed.cnp";
|
filename = "Unnamed.cnp";
|
||||||
this.Text = appName;
|
this.Text = appName.Remove(14);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -699,18 +702,18 @@ private void MainWindow_Activated(object sender, EventArgs e)
|
||||||
|
|
||||||
if (publicVar.encryptionKey == "")
|
if (publicVar.encryptionKey == "")
|
||||||
{
|
{
|
||||||
pictureBox11.Enabled = false;
|
|
||||||
pictureBox13.Enabled = false;
|
|
||||||
pictureBox6.Enabled = false;
|
pictureBox6.Enabled = false;
|
||||||
pictureBox7.Enabled = false;
|
pictureBox7.Enabled = false;
|
||||||
|
pictureBox11.Enabled = false;
|
||||||
|
pictureBox13.Enabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (publicVar.encryptionKey != "")
|
if (publicVar.encryptionKey != "")
|
||||||
{
|
{
|
||||||
pictureBox11.Enabled = true;
|
|
||||||
pictureBox13.Enabled = true;
|
|
||||||
pictureBox6.Enabled = true;
|
pictureBox6.Enabled = true;
|
||||||
pictureBox7.Enabled = true;
|
pictureBox7.Enabled = true;
|
||||||
|
pictureBox11.Enabled = true;
|
||||||
|
pictureBox13.Enabled = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -940,7 +943,7 @@ void AutoLock(bool minimize)
|
||||||
{
|
{
|
||||||
publicVar.encryptionKey = "";
|
publicVar.encryptionKey = "";
|
||||||
customRTB.Clear();
|
customRTB.Clear();
|
||||||
this.Text = appName;
|
this.Text = appName.Remove(14);
|
||||||
OpenFile.FileName = "";
|
OpenFile.FileName = "";
|
||||||
this.Show();
|
this.Show();
|
||||||
return;
|
return;
|
||||||
|
|
@ -954,7 +957,7 @@ void AutoLock(bool minimize)
|
||||||
string NameWithotPath = Path.GetFileName(OpenFile.FileName);
|
string NameWithotPath = Path.GetFileName(OpenFile.FileName);
|
||||||
string de = AES.Decrypt(opnfile, publicVar.encryptionKey, ps.TheSalt, ps.HashAlgorithm, ps.PasswordIterations, "16CHARSLONG12345", ps.KeySize);
|
string de = AES.Decrypt(opnfile, publicVar.encryptionKey, ps.TheSalt, ps.HashAlgorithm, ps.PasswordIterations, "16CHARSLONG12345", ps.KeySize);
|
||||||
|
|
||||||
this.Text = appName + " - " + NameWithotPath;
|
this.Text = appName + NameWithotPath;
|
||||||
filename = OpenFile.FileName;
|
filename = OpenFile.FileName;
|
||||||
|
|
||||||
string cc2 = customRTB.Text.Length.ToString(CultureInfo.InvariantCulture);
|
string cc2 = customRTB.Text.Length.ToString(CultureInfo.InvariantCulture);
|
||||||
|
|
@ -972,7 +975,7 @@ void AutoLock(bool minimize)
|
||||||
{
|
{
|
||||||
publicVar.encryptionKey = "";
|
publicVar.encryptionKey = "";
|
||||||
customRTB.Clear();
|
customRTB.Clear();
|
||||||
this.Text = appName;
|
this.Text = appName.Remove(14);
|
||||||
OpenFile.FileName = "";
|
OpenFile.FileName = "";
|
||||||
this.Show();
|
this.Show();
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue