mirror of
https://github.com/Crypto-Notepad/Crypto-Notepad.git
synced 2026-03-11 08:55:25 +00:00
Fixed #13
This commit is contained in:
parent
df53a93ad4
commit
c5b09db7a8
3 changed files with 177 additions and 147 deletions
102
Crypto Notepad/Form1.Designer.cs
generated
102
Crypto Notepad/Form1.Designer.cs
generated
|
|
@ -31,7 +31,7 @@ public void InitializeComponent()
|
||||||
this.components = new System.ComponentModel.Container();
|
this.components = new System.ComponentModel.Container();
|
||||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainWindow));
|
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainWindow));
|
||||||
this.MainMenu = new System.Windows.Forms.MenuStrip();
|
this.MainMenu = new System.Windows.Forms.MenuStrip();
|
||||||
this.файлToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.FileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.toolStripSeparator11 = new System.Windows.Forms.ToolStripSeparator();
|
this.toolStripSeparator11 = new System.Windows.Forms.ToolStripSeparator();
|
||||||
|
|
@ -42,7 +42,7 @@ public void InitializeComponent()
|
||||||
this.deleteFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.deleteFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
|
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
|
||||||
this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.правкаToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.EditToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.undoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.undoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
|
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
|
||||||
this.cutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.cutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
|
@ -56,11 +56,11 @@ public void InitializeComponent()
|
||||||
this.wordWrapToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.wordWrapToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();
|
this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();
|
||||||
this.clearToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.clearToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.сервисToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.ToolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.changeKeyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.changeKeyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.lockToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.lockToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.settingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.settingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.помощьToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.HelpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.documentationToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.documentationToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.сheckForUpdatesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.сheckForUpdatesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
|
@ -123,10 +123,10 @@ public void InitializeComponent()
|
||||||
//
|
//
|
||||||
this.MainMenu.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
this.MainMenu.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||||
this.MainMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
this.MainMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||||
this.файлToolStripMenuItem,
|
this.FileToolStripMenuItem,
|
||||||
this.правкаToolStripMenuItem,
|
this.EditToolStripMenuItem,
|
||||||
this.сервисToolStripMenuItem,
|
this.ToolsToolStripMenuItem,
|
||||||
this.помощьToolStripMenuItem});
|
this.HelpToolStripMenuItem});
|
||||||
this.MainMenu.Location = new System.Drawing.Point(0, 0);
|
this.MainMenu.Location = new System.Drawing.Point(0, 0);
|
||||||
this.MainMenu.Name = "MainMenu";
|
this.MainMenu.Name = "MainMenu";
|
||||||
this.MainMenu.Padding = new System.Windows.Forms.Padding(0);
|
this.MainMenu.Padding = new System.Windows.Forms.Padding(0);
|
||||||
|
|
@ -135,9 +135,9 @@ public void InitializeComponent()
|
||||||
this.MainMenu.TabIndex = 0;
|
this.MainMenu.TabIndex = 0;
|
||||||
this.MainMenu.Text = "menuStrip1";
|
this.MainMenu.Text = "menuStrip1";
|
||||||
//
|
//
|
||||||
// файлToolStripMenuItem
|
// FileToolStripMenuItem
|
||||||
//
|
//
|
||||||
this.файлToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
this.FileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||||
this.newToolStripMenuItem,
|
this.newToolStripMenuItem,
|
||||||
this.openToolStripMenuItem,
|
this.openToolStripMenuItem,
|
||||||
this.toolStripSeparator11,
|
this.toolStripSeparator11,
|
||||||
|
|
@ -148,10 +148,10 @@ public void InitializeComponent()
|
||||||
this.deleteFileToolStripMenuItem,
|
this.deleteFileToolStripMenuItem,
|
||||||
this.toolStripSeparator2,
|
this.toolStripSeparator2,
|
||||||
this.exitToolStripMenuItem});
|
this.exitToolStripMenuItem});
|
||||||
this.файлToolStripMenuItem.Name = "файлToolStripMenuItem";
|
this.FileToolStripMenuItem.Name = "FileToolStripMenuItem";
|
||||||
this.файлToolStripMenuItem.Size = new System.Drawing.Size(36, 24);
|
this.FileToolStripMenuItem.Size = new System.Drawing.Size(36, 24);
|
||||||
this.файлToolStripMenuItem.Text = "File";
|
this.FileToolStripMenuItem.Text = "File";
|
||||||
this.файлToolStripMenuItem.DropDownOpened += new System.EventHandler(this.файлToolStripMenuItem_DropDownOpened);
|
this.FileToolStripMenuItem.DropDownOpened += new System.EventHandler(this.FileToolStripMenuItem_DropDownOpened);
|
||||||
//
|
//
|
||||||
// newToolStripMenuItem
|
// newToolStripMenuItem
|
||||||
//
|
//
|
||||||
|
|
@ -223,9 +223,9 @@ public void InitializeComponent()
|
||||||
this.exitToolStripMenuItem.Text = "Exit";
|
this.exitToolStripMenuItem.Text = "Exit";
|
||||||
this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click);
|
this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click);
|
||||||
//
|
//
|
||||||
// правкаToolStripMenuItem
|
// EditToolStripMenuItem
|
||||||
//
|
//
|
||||||
this.правкаToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
this.EditToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||||
this.undoToolStripMenuItem,
|
this.undoToolStripMenuItem,
|
||||||
this.toolStripSeparator1,
|
this.toolStripSeparator1,
|
||||||
this.cutToolStripMenuItem,
|
this.cutToolStripMenuItem,
|
||||||
|
|
@ -239,30 +239,30 @@ public void InitializeComponent()
|
||||||
this.wordWrapToolStripMenuItem,
|
this.wordWrapToolStripMenuItem,
|
||||||
this.toolStripSeparator5,
|
this.toolStripSeparator5,
|
||||||
this.clearToolStripMenuItem});
|
this.clearToolStripMenuItem});
|
||||||
this.правкаToolStripMenuItem.Name = "правкаToolStripMenuItem";
|
this.EditToolStripMenuItem.Name = "EditToolStripMenuItem";
|
||||||
this.правкаToolStripMenuItem.Size = new System.Drawing.Size(40, 24);
|
this.EditToolStripMenuItem.Size = new System.Drawing.Size(40, 24);
|
||||||
this.правкаToolStripMenuItem.Text = "Edit";
|
this.EditToolStripMenuItem.Text = "Edit";
|
||||||
this.правкаToolStripMenuItem.DropDownOpened += new System.EventHandler(this.правкаToolStripMenuItem_DropDownOpened);
|
this.EditToolStripMenuItem.DropDownOpened += new System.EventHandler(this.EditToolStripMenuItem_DropDownOpened);
|
||||||
//
|
//
|
||||||
// undoToolStripMenuItem
|
// undoToolStripMenuItem
|
||||||
//
|
//
|
||||||
this.undoToolStripMenuItem.Name = "undoToolStripMenuItem";
|
this.undoToolStripMenuItem.Name = "undoToolStripMenuItem";
|
||||||
this.undoToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Z)));
|
this.undoToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Z)));
|
||||||
this.undoToolStripMenuItem.Size = new System.Drawing.Size(165, 22);
|
this.undoToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||||
this.undoToolStripMenuItem.Text = "Undo";
|
this.undoToolStripMenuItem.Text = "Undo";
|
||||||
this.undoToolStripMenuItem.Click += new System.EventHandler(this.undoToolStripMenuItem_Click);
|
this.undoToolStripMenuItem.Click += new System.EventHandler(this.undoToolStripMenuItem_Click);
|
||||||
//
|
//
|
||||||
// toolStripSeparator1
|
// toolStripSeparator1
|
||||||
//
|
//
|
||||||
this.toolStripSeparator1.Name = "toolStripSeparator1";
|
this.toolStripSeparator1.Name = "toolStripSeparator1";
|
||||||
this.toolStripSeparator1.Size = new System.Drawing.Size(162, 6);
|
this.toolStripSeparator1.Size = new System.Drawing.Size(177, 6);
|
||||||
//
|
//
|
||||||
// cutToolStripMenuItem
|
// cutToolStripMenuItem
|
||||||
//
|
//
|
||||||
this.cutToolStripMenuItem.Enabled = false;
|
this.cutToolStripMenuItem.Enabled = false;
|
||||||
this.cutToolStripMenuItem.Name = "cutToolStripMenuItem";
|
this.cutToolStripMenuItem.Name = "cutToolStripMenuItem";
|
||||||
this.cutToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.X)));
|
this.cutToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.X)));
|
||||||
this.cutToolStripMenuItem.Size = new System.Drawing.Size(165, 22);
|
this.cutToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||||
this.cutToolStripMenuItem.Text = "Cut";
|
this.cutToolStripMenuItem.Text = "Cut";
|
||||||
this.cutToolStripMenuItem.Click += new System.EventHandler(this.cutToolStripMenuItem_Click);
|
this.cutToolStripMenuItem.Click += new System.EventHandler(this.cutToolStripMenuItem_Click);
|
||||||
//
|
//
|
||||||
|
|
@ -271,7 +271,7 @@ public void InitializeComponent()
|
||||||
this.copyToolStripMenuItem.Enabled = false;
|
this.copyToolStripMenuItem.Enabled = false;
|
||||||
this.copyToolStripMenuItem.Name = "copyToolStripMenuItem";
|
this.copyToolStripMenuItem.Name = "copyToolStripMenuItem";
|
||||||
this.copyToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C)));
|
this.copyToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C)));
|
||||||
this.copyToolStripMenuItem.Size = new System.Drawing.Size(165, 22);
|
this.copyToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||||
this.copyToolStripMenuItem.Text = "Copy";
|
this.copyToolStripMenuItem.Text = "Copy";
|
||||||
this.copyToolStripMenuItem.Click += new System.EventHandler(this.copyToolStripMenuItem_Click);
|
this.copyToolStripMenuItem.Click += new System.EventHandler(this.copyToolStripMenuItem_Click);
|
||||||
//
|
//
|
||||||
|
|
@ -279,7 +279,7 @@ public void InitializeComponent()
|
||||||
//
|
//
|
||||||
this.pasteToolStripMenuItem.Name = "pasteToolStripMenuItem";
|
this.pasteToolStripMenuItem.Name = "pasteToolStripMenuItem";
|
||||||
this.pasteToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.V)));
|
this.pasteToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.V)));
|
||||||
this.pasteToolStripMenuItem.Size = new System.Drawing.Size(165, 22);
|
this.pasteToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||||
this.pasteToolStripMenuItem.Text = "Paste";
|
this.pasteToolStripMenuItem.Text = "Paste";
|
||||||
this.pasteToolStripMenuItem.Click += new System.EventHandler(this.pasteToolStripMenuItem_Click);
|
this.pasteToolStripMenuItem.Click += new System.EventHandler(this.pasteToolStripMenuItem_Click);
|
||||||
//
|
//
|
||||||
|
|
@ -288,34 +288,34 @@ public void InitializeComponent()
|
||||||
this.deleteToolStripMenuItem.Enabled = false;
|
this.deleteToolStripMenuItem.Enabled = false;
|
||||||
this.deleteToolStripMenuItem.Name = "deleteToolStripMenuItem";
|
this.deleteToolStripMenuItem.Name = "deleteToolStripMenuItem";
|
||||||
this.deleteToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Delete;
|
this.deleteToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Delete;
|
||||||
this.deleteToolStripMenuItem.Size = new System.Drawing.Size(165, 22);
|
this.deleteToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||||
this.deleteToolStripMenuItem.Text = "Delete";
|
this.deleteToolStripMenuItem.Text = "Delete";
|
||||||
this.deleteToolStripMenuItem.Click += new System.EventHandler(this.deleteToolStripMenuItem_Click);
|
this.deleteToolStripMenuItem.Click += new System.EventHandler(this.deleteToolStripMenuItem_Click);
|
||||||
//
|
//
|
||||||
// toolStripSeparator9
|
// toolStripSeparator9
|
||||||
//
|
//
|
||||||
this.toolStripSeparator9.Name = "toolStripSeparator9";
|
this.toolStripSeparator9.Name = "toolStripSeparator9";
|
||||||
this.toolStripSeparator9.Size = new System.Drawing.Size(162, 6);
|
this.toolStripSeparator9.Size = new System.Drawing.Size(177, 6);
|
||||||
//
|
//
|
||||||
// findToolStripMenuItem2
|
// findToolStripMenuItem2
|
||||||
//
|
//
|
||||||
this.findToolStripMenuItem2.Name = "findToolStripMenuItem2";
|
this.findToolStripMenuItem2.Name = "findToolStripMenuItem2";
|
||||||
this.findToolStripMenuItem2.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F)));
|
this.findToolStripMenuItem2.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F)));
|
||||||
this.findToolStripMenuItem2.Size = new System.Drawing.Size(165, 22);
|
this.findToolStripMenuItem2.Size = new System.Drawing.Size(180, 22);
|
||||||
this.findToolStripMenuItem2.Text = "Find";
|
this.findToolStripMenuItem2.Text = "Find";
|
||||||
this.findToolStripMenuItem2.Click += new System.EventHandler(this.findToolStripMenuItem2_Click);
|
this.findToolStripMenuItem2.Click += new System.EventHandler(this.findToolStripMenuItem2_Click);
|
||||||
//
|
//
|
||||||
// toolStripSeparator3
|
// toolStripSeparator3
|
||||||
//
|
//
|
||||||
this.toolStripSeparator3.Name = "toolStripSeparator3";
|
this.toolStripSeparator3.Name = "toolStripSeparator3";
|
||||||
this.toolStripSeparator3.Size = new System.Drawing.Size(162, 6);
|
this.toolStripSeparator3.Size = new System.Drawing.Size(177, 6);
|
||||||
//
|
//
|
||||||
// selectAllToolStripMenuItem
|
// selectAllToolStripMenuItem
|
||||||
//
|
//
|
||||||
this.selectAllToolStripMenuItem.Name = "selectAllToolStripMenuItem";
|
this.selectAllToolStripMenuItem.Name = "selectAllToolStripMenuItem";
|
||||||
this.selectAllToolStripMenuItem.ShortcutKeyDisplayString = "";
|
this.selectAllToolStripMenuItem.ShortcutKeyDisplayString = "";
|
||||||
this.selectAllToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.A)));
|
this.selectAllToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.A)));
|
||||||
this.selectAllToolStripMenuItem.Size = new System.Drawing.Size(165, 22);
|
this.selectAllToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||||
this.selectAllToolStripMenuItem.Text = "Select All";
|
this.selectAllToolStripMenuItem.Text = "Select All";
|
||||||
this.selectAllToolStripMenuItem.Click += new System.EventHandler(this.selectAllToolStripMenuItem_Click);
|
this.selectAllToolStripMenuItem.Click += new System.EventHandler(this.selectAllToolStripMenuItem_Click);
|
||||||
//
|
//
|
||||||
|
|
@ -325,64 +325,64 @@ public void InitializeComponent()
|
||||||
this.wordWrapToolStripMenuItem.CheckOnClick = true;
|
this.wordWrapToolStripMenuItem.CheckOnClick = true;
|
||||||
this.wordWrapToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
|
this.wordWrapToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||||
this.wordWrapToolStripMenuItem.Name = "wordWrapToolStripMenuItem";
|
this.wordWrapToolStripMenuItem.Name = "wordWrapToolStripMenuItem";
|
||||||
this.wordWrapToolStripMenuItem.Size = new System.Drawing.Size(165, 22);
|
this.wordWrapToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||||
this.wordWrapToolStripMenuItem.Text = "Word Wrap";
|
this.wordWrapToolStripMenuItem.Text = "Word Wrap";
|
||||||
this.wordWrapToolStripMenuItem.Click += new System.EventHandler(this.wordWrapToolStripMenuItem_Click);
|
this.wordWrapToolStripMenuItem.Click += new System.EventHandler(this.wordWrapToolStripMenuItem_Click);
|
||||||
//
|
//
|
||||||
// toolStripSeparator5
|
// toolStripSeparator5
|
||||||
//
|
//
|
||||||
this.toolStripSeparator5.Name = "toolStripSeparator5";
|
this.toolStripSeparator5.Name = "toolStripSeparator5";
|
||||||
this.toolStripSeparator5.Size = new System.Drawing.Size(162, 6);
|
this.toolStripSeparator5.Size = new System.Drawing.Size(177, 6);
|
||||||
//
|
//
|
||||||
// clearToolStripMenuItem
|
// clearToolStripMenuItem
|
||||||
//
|
//
|
||||||
this.clearToolStripMenuItem.Name = "clearToolStripMenuItem";
|
this.clearToolStripMenuItem.Name = "clearToolStripMenuItem";
|
||||||
this.clearToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Delete)));
|
this.clearToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Delete)));
|
||||||
this.clearToolStripMenuItem.Size = new System.Drawing.Size(165, 22);
|
this.clearToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||||
this.clearToolStripMenuItem.Text = "Clear";
|
this.clearToolStripMenuItem.Text = "Clear";
|
||||||
this.clearToolStripMenuItem.Click += new System.EventHandler(this.clearToolStripMenuItem_Click);
|
this.clearToolStripMenuItem.Click += new System.EventHandler(this.clearToolStripMenuItem_Click);
|
||||||
//
|
//
|
||||||
// сервисToolStripMenuItem
|
// ToolsToolStripMenuItem
|
||||||
//
|
//
|
||||||
this.сервисToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
this.ToolsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||||
this.changeKeyToolStripMenuItem,
|
this.changeKeyToolStripMenuItem,
|
||||||
this.lockToolStripMenuItem,
|
this.lockToolStripMenuItem,
|
||||||
this.settingsToolStripMenuItem});
|
this.settingsToolStripMenuItem});
|
||||||
this.сервисToolStripMenuItem.Name = "сервисToolStripMenuItem";
|
this.ToolsToolStripMenuItem.Name = "ToolsToolStripMenuItem";
|
||||||
this.сервисToolStripMenuItem.Size = new System.Drawing.Size(48, 24);
|
this.ToolsToolStripMenuItem.Size = new System.Drawing.Size(48, 24);
|
||||||
this.сервисToolStripMenuItem.Text = "Tools";
|
this.ToolsToolStripMenuItem.Text = "Tools";
|
||||||
this.сервисToolStripMenuItem.DropDownOpened += new System.EventHandler(this.сервисToolStripMenuItem_DropDownOpened);
|
this.ToolsToolStripMenuItem.DropDownOpened += new System.EventHandler(this.ToolsToolStripMenuItem_DropDownOpened);
|
||||||
//
|
//
|
||||||
// changeKeyToolStripMenuItem
|
// changeKeyToolStripMenuItem
|
||||||
//
|
//
|
||||||
this.changeKeyToolStripMenuItem.Name = "changeKeyToolStripMenuItem";
|
this.changeKeyToolStripMenuItem.Name = "changeKeyToolStripMenuItem";
|
||||||
this.changeKeyToolStripMenuItem.Size = new System.Drawing.Size(139, 22);
|
this.changeKeyToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||||
this.changeKeyToolStripMenuItem.Text = "Change Key";
|
this.changeKeyToolStripMenuItem.Text = "Change Key";
|
||||||
this.changeKeyToolStripMenuItem.Click += new System.EventHandler(this.changeKeyToolStripMenuItem_Click);
|
this.changeKeyToolStripMenuItem.Click += new System.EventHandler(this.changeKeyToolStripMenuItem_Click);
|
||||||
//
|
//
|
||||||
// lockToolStripMenuItem
|
// lockToolStripMenuItem
|
||||||
//
|
//
|
||||||
this.lockToolStripMenuItem.Name = "lockToolStripMenuItem";
|
this.lockToolStripMenuItem.Name = "lockToolStripMenuItem";
|
||||||
this.lockToolStripMenuItem.Size = new System.Drawing.Size(139, 22);
|
this.lockToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||||
this.lockToolStripMenuItem.Text = "Lock";
|
this.lockToolStripMenuItem.Text = "Lock";
|
||||||
this.lockToolStripMenuItem.Click += new System.EventHandler(this.lockToolStripMenuItem_Click);
|
this.lockToolStripMenuItem.Click += new System.EventHandler(this.lockToolStripMenuItem_Click);
|
||||||
//
|
//
|
||||||
// settingsToolStripMenuItem
|
// settingsToolStripMenuItem
|
||||||
//
|
//
|
||||||
this.settingsToolStripMenuItem.Name = "settingsToolStripMenuItem";
|
this.settingsToolStripMenuItem.Name = "settingsToolStripMenuItem";
|
||||||
this.settingsToolStripMenuItem.Size = new System.Drawing.Size(139, 22);
|
this.settingsToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||||
this.settingsToolStripMenuItem.Text = "Settings";
|
this.settingsToolStripMenuItem.Text = "Settings";
|
||||||
this.settingsToolStripMenuItem.Click += new System.EventHandler(this.settingsToolStripMenuItem_Click);
|
this.settingsToolStripMenuItem.Click += new System.EventHandler(this.settingsToolStripMenuItem_Click);
|
||||||
//
|
//
|
||||||
// помощьToolStripMenuItem
|
// HelpToolStripMenuItem
|
||||||
//
|
//
|
||||||
this.помощьToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
this.HelpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||||
this.documentationToolStripMenuItem,
|
this.documentationToolStripMenuItem,
|
||||||
this.сheckForUpdatesToolStripMenuItem,
|
this.сheckForUpdatesToolStripMenuItem,
|
||||||
this.aboutToolStripMenuItem});
|
this.aboutToolStripMenuItem});
|
||||||
this.помощьToolStripMenuItem.Name = "помощьToolStripMenuItem";
|
this.HelpToolStripMenuItem.Name = "HelpToolStripMenuItem";
|
||||||
this.помощьToolStripMenuItem.Size = new System.Drawing.Size(43, 24);
|
this.HelpToolStripMenuItem.Size = new System.Drawing.Size(43, 24);
|
||||||
this.помощьToolStripMenuItem.Text = "Help";
|
this.HelpToolStripMenuItem.Text = "Help";
|
||||||
//
|
//
|
||||||
// documentationToolStripMenuItem
|
// documentationToolStripMenuItem
|
||||||
//
|
//
|
||||||
|
|
@ -855,9 +855,9 @@ public void InitializeComponent()
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
private System.Windows.Forms.MenuStrip MainMenu;
|
private System.Windows.Forms.MenuStrip MainMenu;
|
||||||
private System.Windows.Forms.ToolStripMenuItem файлToolStripMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem FileToolStripMenuItem;
|
||||||
private System.Windows.Forms.ToolStripMenuItem правкаToolStripMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem EditToolStripMenuItem;
|
||||||
private System.Windows.Forms.ToolStripMenuItem помощьToolStripMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem HelpToolStripMenuItem;
|
||||||
private System.Windows.Forms.ToolStripMenuItem saveAsToolStripMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem saveAsToolStripMenuItem;
|
||||||
private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
|
||||||
private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem;
|
||||||
|
|
@ -867,7 +867,7 @@ public void InitializeComponent()
|
||||||
private System.Windows.Forms.Button button1;
|
private System.Windows.Forms.Button button1;
|
||||||
public System.Windows.Forms.Button button2;
|
public System.Windows.Forms.Button button2;
|
||||||
private System.Windows.Forms.ToolTip toolTip1;
|
private System.Windows.Forms.ToolTip toolTip1;
|
||||||
private System.Windows.Forms.ToolStripMenuItem сервисToolStripMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem ToolsToolStripMenuItem;
|
||||||
private System.Windows.Forms.ToolStripMenuItem clearToolStripMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem clearToolStripMenuItem;
|
||||||
private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem;
|
||||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
|
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
|
||||||
|
|
|
||||||
|
|
@ -18,14 +18,15 @@ namespace Crypto_Notepad
|
||||||
public partial class MainWindow : Form
|
public partial class MainWindow : Form
|
||||||
{
|
{
|
||||||
Properties.Settings ps = Properties.Settings.Default;
|
Properties.Settings ps = Properties.Settings.Default;
|
||||||
string filename = "Unnamed.cnp";
|
string filePath = "";
|
||||||
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 + " – ";
|
||||||
string currentFilename = "Unnamed.cnp";
|
string currentFilename = "";
|
||||||
bool shiftPresed;
|
bool shiftPresed;
|
||||||
bool cancelPressed = false;
|
bool cancelPressed = false;
|
||||||
bool noExit = false;
|
bool noExit = false;
|
||||||
|
string argsPath = "";
|
||||||
public MainWindow()
|
public MainWindow()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
@ -35,12 +36,10 @@ public MainWindow()
|
||||||
|
|
||||||
void DecryptAES()
|
void DecryptAES()
|
||||||
{
|
{
|
||||||
publicVar.openFileName = Path.GetFileName(OpenFile.FileName);
|
|
||||||
Form2 f2 = new Form2();
|
Form2 f2 = new Form2();
|
||||||
f2.ShowDialog();
|
f2.ShowDialog();
|
||||||
if (publicVar.okPressed == false)
|
if (PublicVar.okPressed == false)
|
||||||
{
|
{
|
||||||
OpenFile.FileName = "";
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (panel1.Visible == true)
|
if (panel1.Visible == true)
|
||||||
|
|
@ -52,19 +51,24 @@ void DecryptAES()
|
||||||
string opnfile = File.ReadAllText(OpenFile.FileName);
|
string opnfile = File.ReadAllText(OpenFile.FileName);
|
||||||
string NameWithotPath = Path.GetFileName(OpenFile.FileName);
|
string NameWithotPath = Path.GetFileName(OpenFile.FileName);
|
||||||
|
|
||||||
string de = AES.Decrypt(opnfile, publicVar.encryptionKey.Get(), ps.TheSalt, ps.HashAlgorithm, ps.PasswordIterations, ps.KeySize);
|
string de = AES.Decrypt(opnfile, TypedPassword.Value, ps.TheSalt, ps.HashAlgorithm, ps.PasswordIterations, ps.KeySize);
|
||||||
customRTB.Text = de;
|
customRTB.Text = de;
|
||||||
|
|
||||||
this.Text = appName + NameWithotPath;
|
this.Text = appName + NameWithotPath;
|
||||||
filename = OpenFile.FileName;
|
filePath = OpenFile.FileName;
|
||||||
|
|
||||||
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);
|
||||||
|
|
||||||
|
PublicVar.openFileName = Path.GetFileName(OpenFile.FileName);
|
||||||
|
currentFilename = Path.GetFileName(OpenFile.FileName);
|
||||||
|
PublicVar.encryptionKey.Set(TypedPassword.Value);
|
||||||
|
TypedPassword.Value = null;
|
||||||
}
|
}
|
||||||
catch (CryptographicException)
|
catch (CryptographicException)
|
||||||
{
|
{
|
||||||
using (new CenterWinDialog(this))
|
using (new CenterWinDialog(this))
|
||||||
{
|
{
|
||||||
|
TypedPassword.Value = null;
|
||||||
DialogResult dialogResult = MessageBox.Show("Invalid key!", "Crypto Notepad", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error);
|
DialogResult dialogResult = MessageBox.Show("Invalid key!", "Crypto Notepad", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error);
|
||||||
if (dialogResult == DialogResult.Retry)
|
if (dialogResult == DialogResult.Retry)
|
||||||
{
|
{
|
||||||
|
|
@ -72,7 +76,7 @@ void DecryptAES()
|
||||||
}
|
}
|
||||||
if (dialogResult == DialogResult.Cancel)
|
if (dialogResult == DialogResult.Cancel)
|
||||||
{
|
{
|
||||||
publicVar.encryptionKey.Set(null);
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -80,6 +84,7 @@ void DecryptAES()
|
||||||
|
|
||||||
private void openToolStripMenuItem_Click(object sender, EventArgs e)
|
private void openToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
OpenFile.FileName = "";
|
||||||
saveConfirm(false);
|
saveConfirm(false);
|
||||||
if (cancelPressed == true)
|
if (cancelPressed == true)
|
||||||
{
|
{
|
||||||
|
|
@ -89,6 +94,7 @@ private void openToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
|
||||||
if (OpenFile.ShowDialog() != DialogResult.OK) return;
|
if (OpenFile.ShowDialog() != DialogResult.OK) return;
|
||||||
{
|
{
|
||||||
|
PublicVar.openFileName = Path.GetFileName(OpenFile.FileName);
|
||||||
if (!OpenFile.FileName.Contains(".cnp"))
|
if (!OpenFile.FileName.Contains(".cnp"))
|
||||||
{
|
{
|
||||||
string opnfile = File.ReadAllText(OpenFile.FileName);
|
string opnfile = File.ReadAllText(OpenFile.FileName);
|
||||||
|
|
@ -107,10 +113,9 @@ private void openToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
customRTB.Modified = false;
|
customRTB.Modified = false;
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
if (publicVar.okPressed == true)
|
if (PublicVar.okPressed == true)
|
||||||
{
|
{
|
||||||
publicVar.okPressed = false;
|
PublicVar.okPressed = false;
|
||||||
currentFilename = Path.GetFileName(OpenFile.FileName);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -129,24 +134,27 @@ private void openAsotiations()
|
||||||
string opnfile = File.ReadAllText(args[1]);
|
string opnfile = File.ReadAllText(args[1]);
|
||||||
|
|
||||||
Form2.ShowDialog();
|
Form2.ShowDialog();
|
||||||
if (publicVar.okPressed == false)
|
if (PublicVar.okPressed == false)
|
||||||
{
|
{
|
||||||
OpenFile.FileName = "";
|
OpenFile.FileName = "";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
publicVar.okPressed = false;
|
PublicVar.okPressed = false;
|
||||||
|
|
||||||
string de = AES.Decrypt(opnfile, publicVar.encryptionKey.Get(), ps.TheSalt, ps.HashAlgorithm, ps.PasswordIterations, ps.KeySize);
|
string de = AES.Decrypt(opnfile, TypedPassword.Value, ps.TheSalt, ps.HashAlgorithm, ps.PasswordIterations, ps.KeySize);
|
||||||
customRTB.Text = de;
|
customRTB.Text = de;
|
||||||
|
|
||||||
this.Text = appName + NameWithotPath;
|
this.Text = appName + NameWithotPath;
|
||||||
|
|
||||||
filename = args[1];
|
filePath = args[1];
|
||||||
string cc = customRTB.Text.Length.ToString(CultureInfo.InvariantCulture);
|
string cc = customRTB.Text.Length.ToString(CultureInfo.InvariantCulture);
|
||||||
|
PublicVar.encryptionKey.Set(TypedPassword.Value);
|
||||||
customRTB.Select(Convert.ToInt32(cc), 0);
|
customRTB.Select(Convert.ToInt32(cc), 0);
|
||||||
|
TypedPassword.Value = null;
|
||||||
}
|
}
|
||||||
catch (CryptographicException)
|
catch (CryptographicException)
|
||||||
{
|
{
|
||||||
|
TypedPassword.Value = null;
|
||||||
DialogResult dialogResult = MessageBox.Show("Invalid key!", "Crypto Notepad", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error);
|
DialogResult dialogResult = MessageBox.Show("Invalid key!", "Crypto Notepad", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error);
|
||||||
if (dialogResult == DialogResult.Retry)
|
if (dialogResult == DialogResult.Retry)
|
||||||
{
|
{
|
||||||
|
|
@ -172,20 +180,22 @@ private void newToolStripMenuItem_Click_1(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
saveConfirm(false);
|
saveConfirm(false);
|
||||||
SaveFile.FileName = "Unnamed.cnp";
|
SaveFile.FileName = "Unnamed.cnp";
|
||||||
publicVar.openFileName = "Crypto Notepad";
|
PublicVar.openFileName = "Crypto Notepad";
|
||||||
Form2 f2 = new Form2();
|
Form2 f2 = new Form2();
|
||||||
f2.ShowDialog();
|
f2.ShowDialog();
|
||||||
|
PublicVar.encryptionKey.Set(TypedPassword.Value);
|
||||||
if (publicVar.okPressed == false)
|
if (PublicVar.okPressed == false)
|
||||||
{
|
{
|
||||||
|
TypedPassword.Value = null;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (publicVar.okPressed == true)
|
if (PublicVar.okPressed == true)
|
||||||
{
|
{
|
||||||
publicVar.okPressed = false;
|
PublicVar.okPressed = false;
|
||||||
if (SaveFile.ShowDialog() != DialogResult.OK)
|
if (SaveFile.ShowDialog() != DialogResult.OK)
|
||||||
{
|
{
|
||||||
|
TypedPassword.Value = null;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -193,9 +203,11 @@ private void newToolStripMenuItem_Click_1(object sender, EventArgs e)
|
||||||
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;
|
filePath = SaveFile.FileName;
|
||||||
|
currentFilename = Path.GetFileName(SaveFile.FileName);
|
||||||
sw.Close();
|
sw.Close();
|
||||||
}
|
}
|
||||||
|
TypedPassword.Value = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void saveAsToolStripMenuItem_Click(object sender, EventArgs e)
|
private void saveAsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
|
@ -203,15 +215,16 @@ private void saveAsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
int saveCaret = customRTB.SelectionStart;
|
int saveCaret = customRTB.SelectionStart;
|
||||||
string NameWithotPath = Path.GetFileName(OpenFile.FileName);
|
string NameWithotPath = Path.GetFileName(OpenFile.FileName);
|
||||||
SaveFile.FileName = currentFilename;
|
SaveFile.FileName = currentFilename;
|
||||||
if (string.IsNullOrEmpty(publicVar.encryptionKey.Get()))
|
Form2 f2 = new Form2();
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(PublicVar.encryptionKey.Get()))
|
||||||
{
|
{
|
||||||
Form2 Form2 = new Form2();
|
f2.ShowDialog();
|
||||||
Form2.ShowDialog();
|
if (PublicVar.okPressed == false)
|
||||||
if (publicVar.okPressed == false)
|
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
publicVar.okPressed = false;
|
PublicVar.okPressed = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SaveFile.ShowDialog() != DialogResult.OK)
|
if (SaveFile.ShowDialog() != DialogResult.OK)
|
||||||
|
|
@ -219,21 +232,25 @@ private void saveAsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
filename = SaveFile.FileName;
|
if (TypedPassword.Value == null)
|
||||||
|
{
|
||||||
|
TypedPassword.Value = PublicVar.encryptionKey.Get();
|
||||||
|
}
|
||||||
|
|
||||||
|
filePath = SaveFile.FileName;
|
||||||
string noenc = customRTB.Text;
|
string noenc = customRTB.Text;
|
||||||
string en;
|
string en;
|
||||||
if (publicVar.randomizeSalts)
|
if (PublicVar.randomizeSalts)
|
||||||
{
|
{
|
||||||
en = AES.Encrypt(customRTB.Text, publicVar.encryptionKey.Get(), null, ps.HashAlgorithm, ps.PasswordIterations, ps.KeySize);
|
en = AES.Encrypt(customRTB.Text, TypedPassword.Value, null, ps.HashAlgorithm, ps.PasswordIterations, ps.KeySize);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
en = AES.Encrypt(customRTB.Text, publicVar.encryptionKey.Get(), ps.TheSalt, ps.HashAlgorithm, ps.PasswordIterations, ps.KeySize);
|
en = AES.Encrypt(customRTB.Text, TypedPassword.Value, ps.TheSalt, ps.HashAlgorithm, ps.PasswordIterations, ps.KeySize);
|
||||||
}
|
}
|
||||||
|
|
||||||
customRTB.Text = en;
|
customRTB.Text = en;
|
||||||
StreamWriter sw = new StreamWriter(filename);
|
StreamWriter sw = new StreamWriter(filePath);
|
||||||
int i = customRTB.Lines.Count();
|
int i = customRTB.Lines.Count();
|
||||||
int j = 0;
|
int j = 0;
|
||||||
i = i - 1;
|
i = i - 1;
|
||||||
|
|
@ -244,9 +261,11 @@ private void saveAsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
}
|
}
|
||||||
sw.Close();
|
sw.Close();
|
||||||
customRTB.Text = noenc;
|
customRTB.Text = noenc;
|
||||||
this.Text = appName + Path.GetFileName(filename);
|
this.Text = appName + Path.GetFileName(filePath);
|
||||||
|
|
||||||
customRTB.Select(Convert.ToInt32(saveCaret), 0);
|
customRTB.Select(Convert.ToInt32(saveCaret), 0);
|
||||||
|
PublicVar.encryptionKey.Set(TypedPassword.Value);
|
||||||
|
TypedPassword.Value = null;
|
||||||
|
currentFilename = Path.GetFileName(SaveFile.FileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void MainWindow_FormClosing(object sender, FormClosingEventArgs e)
|
private void MainWindow_FormClosing(object sender, FormClosingEventArgs e)
|
||||||
|
|
@ -372,32 +391,32 @@ private void saveToolStripMenuItem1_Click_1(object sender, EventArgs e)
|
||||||
string NameWithotPath = Path.GetFileName(OpenFile.FileName);
|
string NameWithotPath = Path.GetFileName(OpenFile.FileName);
|
||||||
int saveCaret = customRTB.SelectionStart;
|
int saveCaret = customRTB.SelectionStart;
|
||||||
|
|
||||||
if (filename == noname)
|
if (PublicVar.encryptionKey.Get() == null)
|
||||||
{
|
{
|
||||||
SaveFile.FileName = noname;
|
SaveFile.FileName = noname;
|
||||||
saveAsToolStripMenuItem_Click(this, new EventArgs());
|
saveAsToolStripMenuItem_Click(this, new EventArgs());
|
||||||
|
|
||||||
if (publicVar.okPressed == false)
|
if (PublicVar.okPressed == false)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
publicVar.okPressed = false;
|
PublicVar.okPressed = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
string noenc = customRTB.Text;
|
string noenc = customRTB.Text;
|
||||||
string en;
|
string en;
|
||||||
if (publicVar.randomizeSalts)
|
if (PublicVar.randomizeSalts)
|
||||||
{
|
{
|
||||||
en = AES.Encrypt(customRTB.Text, publicVar.encryptionKey.Get(), null, ps.HashAlgorithm, ps.PasswordIterations, ps.KeySize);
|
en = AES.Encrypt(customRTB.Text, PublicVar.encryptionKey.Get(), null, ps.HashAlgorithm, ps.PasswordIterations, ps.KeySize);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
en = AES.Encrypt(customRTB.Text, publicVar.encryptionKey.Get(), ps.TheSalt, ps.HashAlgorithm, ps.PasswordIterations, ps.KeySize);
|
en = AES.Encrypt(customRTB.Text, PublicVar.encryptionKey.Get(), ps.TheSalt, ps.HashAlgorithm, ps.PasswordIterations, ps.KeySize);
|
||||||
}
|
}
|
||||||
|
|
||||||
customRTB.Text = en;
|
customRTB.Text = en;
|
||||||
StreamWriter sw = new StreamWriter(filename);
|
StreamWriter sw = new StreamWriter(filePath);
|
||||||
int i = customRTB.Lines.Count();
|
int i = customRTB.Lines.Count();
|
||||||
int j = 0;
|
int j = 0;
|
||||||
i = i - 1;
|
i = i - 1;
|
||||||
|
|
@ -411,6 +430,7 @@ private void saveToolStripMenuItem1_Click_1(object sender, EventArgs e)
|
||||||
sw.Close();
|
sw.Close();
|
||||||
customRTB.Text = noenc;
|
customRTB.Text = noenc;
|
||||||
customRTB.Select(Convert.ToInt32(saveCaret), 0);
|
customRTB.Select(Convert.ToInt32(saveCaret), 0);
|
||||||
|
PublicVar.keyChanged = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
|
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
|
@ -468,20 +488,21 @@ private void pasteToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
|
||||||
private void deleteFileToolStripMenuItem_Click_1(object sender, EventArgs e)
|
private void deleteFileToolStripMenuItem_Click_1(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (filename != "Unnamed.cnp")
|
if (filePath != "")
|
||||||
{
|
{
|
||||||
using (new CenterWinDialog(this))
|
using (new CenterWinDialog(this))
|
||||||
{
|
{
|
||||||
if (MessageBox.Show("Delete file: " + "\"" + filename + "\"" + " ?", "Crypto Notepad", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
|
if (MessageBox.Show("Delete file: " + "\"" + filePath + "\"" + " ?", "Crypto Notepad", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
|
||||||
{
|
{
|
||||||
File.Delete(filename);
|
File.Delete(filePath);
|
||||||
customRTB.Clear();
|
customRTB.Clear();
|
||||||
publicVar.encryptionKey.Set(null);
|
PublicVar.encryptionKey.Set(null);
|
||||||
pictureBox6.Enabled = false;
|
pictureBox6.Enabled = false;
|
||||||
pictureBox7.Enabled = false;
|
pictureBox7.Enabled = false;
|
||||||
pictureBox11.Enabled = false;
|
pictureBox11.Enabled = false;
|
||||||
pictureBox13.Enabled = false;
|
pictureBox13.Enabled = false;
|
||||||
filename = "Unnamed.cnp";
|
filePath = "";
|
||||||
|
currentFilename = "Unnamed.cnp";
|
||||||
this.Text = appName.Remove(14);
|
this.Text = appName.Remove(14);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -491,10 +512,7 @@ private void deleteFileToolStripMenuItem_Click_1(object sender, EventArgs e)
|
||||||
|
|
||||||
private void openFileLocationToolStripMenuItem_Click(object sender, EventArgs e)
|
private void openFileLocationToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (filename != "Unnamed.cnp")
|
Process.Start("explorer.exe", @"/select, " + filePath);
|
||||||
{
|
|
||||||
Process.Start("explorer.exe", @"/select, " + filename);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void wordWrapToolStripMenuItem_Click(object sender, EventArgs e)
|
private void wordWrapToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
|
@ -656,9 +674,9 @@ private void settingsToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
|
||||||
private void MainWindow_Activated(object sender, EventArgs e)
|
private void MainWindow_Activated(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (publicVar.settingsChanged == true)
|
if (PublicVar.settingsChanged == true)
|
||||||
{
|
{
|
||||||
publicVar.settingsChanged = false;
|
PublicVar.settingsChanged = false;
|
||||||
customRTB.Font = new Font(ps.RichTextFont, ps.RichTextSize);
|
customRTB.Font = new Font(ps.RichTextFont, ps.RichTextSize);
|
||||||
customRTB.ForeColor = ps.RichForeColor;
|
customRTB.ForeColor = ps.RichForeColor;
|
||||||
customRTB.BackColor = ps.RichBackColor;
|
customRTB.BackColor = ps.RichBackColor;
|
||||||
|
|
@ -702,12 +720,12 @@ private void MainWindow_Activated(object sender, EventArgs e)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (publicVar.keyChanged == true)
|
if (PublicVar.keyChanged == true)
|
||||||
{
|
{
|
||||||
customRTB.Modified = true;
|
customRTB.Modified = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (publicVar.encryptionKey.Get() == null)
|
if (PublicVar.encryptionKey.Get() == null)
|
||||||
{
|
{
|
||||||
pictureBox6.Enabled = false;
|
pictureBox6.Enabled = false;
|
||||||
pictureBox7.Enabled = false;
|
pictureBox7.Enabled = false;
|
||||||
|
|
@ -715,7 +733,7 @@ private void MainWindow_Activated(object sender, EventArgs e)
|
||||||
pictureBox13.Enabled = false;
|
pictureBox13.Enabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (publicVar.encryptionKey.Get() != null)
|
if (PublicVar.encryptionKey.Get() != null)
|
||||||
{
|
{
|
||||||
pictureBox6.Enabled = true;
|
pictureBox6.Enabled = true;
|
||||||
pictureBox7.Enabled = true;
|
pictureBox7.Enabled = true;
|
||||||
|
|
@ -758,18 +776,21 @@ private void findToolStripMenuItem2_Click(object sender, EventArgs e)
|
||||||
|
|
||||||
private void documentationToolStripMenuItem_Click(object sender, EventArgs e)
|
private void documentationToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Process.Start("https://github.com/Sigmanor/Crypto-Notepad/wiki/Documentation");
|
//Process.Start("https://github.com/Sigmanor/Crypto-Notepad/wiki/Documentation");
|
||||||
|
MessageBox.Show("currentFilename: "+ currentFilename);
|
||||||
|
MessageBox.Show("encryptionKey: " + PublicVar.encryptionKey.Get());
|
||||||
|
MessageBox.Show("TypedPassword: " + TypedPassword.Value);
|
||||||
|
MessageBox.Show("filePath: " + filePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void сервисToolStripMenuItem_DropDownOpened(object sender, EventArgs e)
|
private void ToolsToolStripMenuItem_DropDownOpened(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (publicVar.encryptionKey.Get() == null)
|
if (PublicVar.encryptionKey.Get() == null)
|
||||||
{
|
{
|
||||||
changeKeyToolStripMenuItem.Enabled = false;
|
changeKeyToolStripMenuItem.Enabled = false;
|
||||||
lockToolStripMenuItem.Enabled = false;
|
lockToolStripMenuItem.Enabled = false;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
if (publicVar.encryptionKey.Get() != null)
|
|
||||||
{
|
{
|
||||||
changeKeyToolStripMenuItem.Enabled = true;
|
changeKeyToolStripMenuItem.Enabled = true;
|
||||||
lockToolStripMenuItem.Enabled = true;
|
lockToolStripMenuItem.Enabled = true;
|
||||||
|
|
@ -867,7 +888,7 @@ private void pictureBox13_Click(object sender, EventArgs e)
|
||||||
AutoLock(false);
|
AutoLock(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void правкаToolStripMenuItem_DropDownOpened(object sender, EventArgs e)
|
private void EditToolStripMenuItem_DropDownOpened(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (customRTB.SelectionLength != 0)
|
if (customRTB.SelectionLength != 0)
|
||||||
{
|
{
|
||||||
|
|
@ -947,9 +968,8 @@ private void pictureBox13_Click(object sender, EventArgs e)
|
||||||
|
|
||||||
void AutoLock(bool minimize)
|
void AutoLock(bool minimize)
|
||||||
{
|
{
|
||||||
saveToolStripMenuItem1_Click_1(this, new EventArgs());
|
|
||||||
Form2 f2 = new Form2();
|
Form2 f2 = new Form2();
|
||||||
publicVar.encryptionKey.Set(null);
|
PublicVar.encryptionKey.Set(null);
|
||||||
caretPos = customRTB.SelectionStart;
|
caretPos = customRTB.SelectionStart;
|
||||||
f2.MinimizeBox = true;
|
f2.MinimizeBox = true;
|
||||||
this.Hide();
|
this.Hide();
|
||||||
|
|
@ -960,35 +980,38 @@ void AutoLock(bool minimize)
|
||||||
}
|
}
|
||||||
f2.ShowDialog();
|
f2.ShowDialog();
|
||||||
|
|
||||||
if (publicVar.okPressed == false)
|
if (PublicVar.okPressed == false)
|
||||||
{
|
{
|
||||||
publicVar.encryptionKey.Set(null);
|
PublicVar.encryptionKey.Set(null);
|
||||||
customRTB.Clear();
|
customRTB.Clear();
|
||||||
this.Text = appName.Remove(14);
|
this.Text = appName.Remove(14);
|
||||||
OpenFile.FileName = "";
|
OpenFile.FileName = "";
|
||||||
this.Show();
|
this.Show();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
publicVar.okPressed = false;
|
PublicVar.okPressed = false;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
OpenFile.FileName = filename;
|
OpenFile.FileName = filePath;
|
||||||
string opnfile = File.ReadAllText(OpenFile.FileName);
|
string opnfile = File.ReadAllText(OpenFile.FileName);
|
||||||
string NameWithotPath = Path.GetFileName(OpenFile.FileName);
|
string NameWithotPath = Path.GetFileName(OpenFile.FileName);
|
||||||
string de = AES.Decrypt(opnfile, publicVar.encryptionKey.Get(), ps.TheSalt, ps.HashAlgorithm, ps.PasswordIterations, ps.KeySize);
|
string de = AES.Decrypt(opnfile, TypedPassword.Value, ps.TheSalt, ps.HashAlgorithm, ps.PasswordIterations, ps.KeySize);
|
||||||
|
|
||||||
this.Text = appName + NameWithotPath;
|
this.Text = appName + NameWithotPath;
|
||||||
filename = OpenFile.FileName;
|
filePath = OpenFile.FileName;
|
||||||
|
|
||||||
string cc2 = customRTB.Text.Length.ToString(CultureInfo.InvariantCulture);
|
string cc2 = customRTB.Text.Length.ToString(CultureInfo.InvariantCulture);
|
||||||
customRTB.SelectionStart = caretPos;
|
customRTB.SelectionStart = caretPos;
|
||||||
|
PublicVar.encryptionKey.Set(TypedPassword.Value);
|
||||||
|
TypedPassword.Value = null;
|
||||||
this.Show();
|
this.Show();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
if (ex is CryptographicException)
|
if (ex is CryptographicException)
|
||||||
{
|
{
|
||||||
|
TypedPassword.Value = null;
|
||||||
DialogResult dialogResult = MessageBox.Show("Invalid key!", "Crypto Notepad", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error);
|
DialogResult dialogResult = MessageBox.Show("Invalid key!", "Crypto Notepad", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error);
|
||||||
if (dialogResult == DialogResult.Retry)
|
if (dialogResult == DialogResult.Retry)
|
||||||
{
|
{
|
||||||
|
|
@ -996,7 +1019,7 @@ void AutoLock(bool minimize)
|
||||||
}
|
}
|
||||||
if (dialogResult == DialogResult.Cancel)
|
if (dialogResult == DialogResult.Cancel)
|
||||||
{
|
{
|
||||||
publicVar.encryptionKey.Set(null);
|
PublicVar.encryptionKey.Set(null);
|
||||||
customRTB.Clear();
|
customRTB.Clear();
|
||||||
this.Text = appName.Remove(14);
|
this.Text = appName.Remove(14);
|
||||||
OpenFile.FileName = "";
|
OpenFile.FileName = "";
|
||||||
|
|
@ -1012,7 +1035,7 @@ protected override void WndProc(ref Message m)
|
||||||
const int WM_SYSCOMMAND = 0x112;
|
const int WM_SYSCOMMAND = 0x112;
|
||||||
const int SC_MINIMIZE = 0xF020;
|
const int SC_MINIMIZE = 0xF020;
|
||||||
|
|
||||||
if (m.Msg == WM_SYSCOMMAND && m.WParam.ToInt32() == SC_MINIMIZE && ps.AutoLock == true && publicVar.encryptionKey.Get() != null)
|
if (m.Msg == WM_SYSCOMMAND && m.WParam.ToInt32() == SC_MINIMIZE && ps.AutoLock == true && PublicVar.encryptionKey.Get() != null)
|
||||||
{
|
{
|
||||||
AutoLock(true);
|
AutoLock(true);
|
||||||
return;
|
return;
|
||||||
|
|
@ -1023,18 +1046,25 @@ protected override void WndProc(ref Message m)
|
||||||
|
|
||||||
private void lockToolStripMenuItem_Click(object sender, EventArgs e)
|
private void lockToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
if (ps.AutoSave)
|
||||||
|
{
|
||||||
|
saveToolStripMenuItem1_Click_1(this, new EventArgs());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
saveConfirm(false);
|
||||||
|
}
|
||||||
AutoLock(false);
|
AutoLock(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void файлToolStripMenuItem_DropDownOpened(object sender, EventArgs e)
|
private void FileToolStripMenuItem_DropDownOpened(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (OpenFile.FileName == "")
|
if (currentFilename == "")
|
||||||
{
|
{
|
||||||
openFileLocationToolStripMenuItem.Enabled = false;
|
openFileLocationToolStripMenuItem.Enabled = false;
|
||||||
deleteFileToolStripMenuItem.Enabled = false;
|
deleteFileToolStripMenuItem.Enabled = false;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
if (OpenFile.FileName != "")
|
|
||||||
{
|
{
|
||||||
openFileLocationToolStripMenuItem.Enabled = true;
|
openFileLocationToolStripMenuItem.Enabled = true;
|
||||||
deleteFileToolStripMenuItem.Enabled = true;
|
deleteFileToolStripMenuItem.Enabled = true;
|
||||||
|
|
@ -1089,14 +1119,15 @@ private void customRTB_DragDrop(object sender, DragEventArgs e)
|
||||||
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);
|
||||||
|
currentFilename = Path.GetFileName(OpenFile.FileName);
|
||||||
|
filePath = OpenFile.FileName;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
PublicVar.openFileName = Path.GetFileName(OpenFile.FileName);
|
||||||
DecryptAES();
|
DecryptAES();
|
||||||
if (publicVar.okPressed == true)
|
if (PublicVar.okPressed == true)
|
||||||
{
|
{
|
||||||
publicVar.okPressed = false;
|
PublicVar.okPressed = false;
|
||||||
currentFilename = Path.GetFileName(OpenFile.FileName);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1114,18 +1145,21 @@ public void saveConfirm(bool exit)
|
||||||
|
|
||||||
if (customRTB.Modified == true)
|
if (customRTB.Modified == true)
|
||||||
{
|
{
|
||||||
string noname = "Unnamed.cnp";
|
if (currentFilename == "")
|
||||||
|
{
|
||||||
|
currentFilename = "Unnamed.cnp";
|
||||||
|
}
|
||||||
|
|
||||||
if (customRTB.Text != "")
|
if (customRTB.Text != "")
|
||||||
{
|
{
|
||||||
DialogResult res = new DialogResult();
|
DialogResult res = new DialogResult();
|
||||||
string messageBoxText = "";
|
string messageBoxText = "";
|
||||||
|
|
||||||
if (publicVar.keyChanged == false)
|
if (PublicVar.keyChanged == false)
|
||||||
{
|
{
|
||||||
messageBoxText = "Save file: " + "\"" + currentFilename + "\"" + " ? ";
|
messageBoxText = "Save file: " + "\"" + currentFilename + "\"" + " ? ";
|
||||||
}
|
}
|
||||||
if (publicVar.keyChanged == true)
|
if (PublicVar.keyChanged == true)
|
||||||
{
|
{
|
||||||
messageBoxText = "Save file: " + "\"" + currentFilename + "\"" + " with a new key? ";
|
messageBoxText = "Save file: " + "\"" + currentFilename + "\"" + " with a new key? ";
|
||||||
}
|
}
|
||||||
|
|
@ -1137,22 +1171,12 @@ public void saveConfirm(bool exit)
|
||||||
MessageBoxIcon.Question);
|
MessageBoxIcon.Question);
|
||||||
if (res == DialogResult.Yes)
|
if (res == DialogResult.Yes)
|
||||||
{
|
{
|
||||||
if (filename == noname)
|
saveToolStripMenuItem1_Click_1(this, new EventArgs());
|
||||||
|
if (exit == true)
|
||||||
{
|
{
|
||||||
SaveFile.FileName = noname;
|
Environment.Exit(0);
|
||||||
saveAsToolStripMenuItem_Click(this, new EventArgs());
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (filename != noname)
|
|
||||||
{
|
|
||||||
saveToolStripMenuItem1_Click_1(this, new EventArgs());
|
|
||||||
|
|
||||||
if (exit == true)
|
|
||||||
{
|
|
||||||
Environment.Exit(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (res == DialogResult.No)
|
if (res == DialogResult.No)
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ static void Main()
|
||||||
}
|
}
|
||||||
|
|
||||||
static class publicVar
|
static class publicVar
|
||||||
|
static class PublicVar
|
||||||
{
|
{
|
||||||
public static EncryptedString encryptionKey = new EncryptedString();
|
public static EncryptedString encryptionKey = new EncryptedString();
|
||||||
public static bool randomizeSalts = true;
|
public static bool randomizeSalts = true;
|
||||||
|
|
@ -27,4 +28,9 @@ static class publicVar
|
||||||
public static string openFileName = "Crypto Notepad";
|
public static string openFileName = "Crypto Notepad";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static class TypedPassword
|
||||||
|
{
|
||||||
|
public static string Value { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue