добавляет импорт файла
This commit is contained in:
parent
46cc1d3463
commit
6442b02b27
@ -54,7 +54,6 @@ namespace AwesomeEmailExtractor
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
adminUtils.editUser(editedUser);
|
adminUtils.editUser(editedUser);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
12
MainForm.Designer.cs
generated
12
MainForm.Designer.cs
generated
@ -43,6 +43,7 @@
|
|||||||
this.administrationToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.administrationToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.importToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.resultStatusStrip.SuspendLayout();
|
this.resultStatusStrip.SuspendLayout();
|
||||||
this.menuStrip1.SuspendLayout();
|
this.menuStrip1.SuspendLayout();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
@ -124,7 +125,8 @@
|
|||||||
// fileToolStripMenuItem
|
// fileToolStripMenuItem
|
||||||
//
|
//
|
||||||
this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||||
this.exportResultToolStripMenuItem});
|
this.exportResultToolStripMenuItem,
|
||||||
|
this.importToolStripMenuItem});
|
||||||
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
|
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
|
||||||
this.fileToolStripMenuItem.Size = new System.Drawing.Size(48, 20);
|
this.fileToolStripMenuItem.Size = new System.Drawing.Size(48, 20);
|
||||||
this.fileToolStripMenuItem.Text = "Файл";
|
this.fileToolStripMenuItem.Text = "Файл";
|
||||||
@ -182,6 +184,13 @@
|
|||||||
this.helpToolStripMenuItem.Text = "Справка";
|
this.helpToolStripMenuItem.Text = "Справка";
|
||||||
this.helpToolStripMenuItem.Click += new System.EventHandler(this.helpToolStripMenuItem_Click);
|
this.helpToolStripMenuItem.Click += new System.EventHandler(this.helpToolStripMenuItem_Click);
|
||||||
//
|
//
|
||||||
|
// importToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.importToolStripMenuItem.Name = "importToolStripMenuItem";
|
||||||
|
this.importToolStripMenuItem.Size = new System.Drawing.Size(219, 22);
|
||||||
|
this.importToolStripMenuItem.Text = "Импортировать файл";
|
||||||
|
this.importToolStripMenuItem.Click += new System.EventHandler(this.importToolStripMenuItem_Click);
|
||||||
|
//
|
||||||
// MainForm
|
// MainForm
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
@ -223,6 +232,7 @@
|
|||||||
private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
|
||||||
private System.Windows.Forms.ToolStripMenuItem journalToolStripMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem journalToolStripMenuItem;
|
||||||
private System.Windows.Forms.ToolStripMenuItem exportResultToolStripMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem exportResultToolStripMenuItem;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem importToolStripMenuItem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
19
MainForm.cs
19
MainForm.cs
@ -111,5 +111,24 @@ namespace AwesomeEmailExtractor
|
|||||||
HelpForm helpForm = FormManager.Current.CreateForm<HelpForm>();
|
HelpForm helpForm = FormManager.Current.CreateForm<HelpForm>();
|
||||||
helpForm.ShowDialog(this);
|
helpForm.ShowDialog(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void importToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// Показать окно с выбором файла
|
||||||
|
OpenFileDialog openFileDialog = new OpenFileDialog();
|
||||||
|
openFileDialog.Filter = "Текстовый файл (*.txt)|*.txt";
|
||||||
|
|
||||||
|
var res = openFileDialog.ShowDialog();
|
||||||
|
|
||||||
|
// Загрузить текст из файла
|
||||||
|
if (res == DialogResult.OK)
|
||||||
|
{
|
||||||
|
string fileName = openFileDialog.FileName;
|
||||||
|
string sourceText = System.IO.File.ReadAllText(fileName);
|
||||||
|
|
||||||
|
sourceRichTextBox.Text = sourceText;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user