From 2ec11df68327b9b381324c009934eba0d53a8052 Mon Sep 17 00:00:00 2001 From: Maxim Slipenko Date: Sat, 14 May 2022 09:53:01 +0300 Subject: [PATCH 1/8] =?UTF-8?q?=D1=81=D0=BE=D0=B7=D0=B4=D0=B0=D0=B5=D1=82?= =?UTF-8?q?=20=D0=BF=D1=80=D0=BE=D0=B5=D0=BA=D1=82=20Visual=20Studio?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.config | 6 ++ AwesomeEmailExtractor.csproj | 80 +++++++++++++++++++++ AwesomeEmailExtractor.sln | 25 +++++++ Form1.Designer.cs | 40 +++++++++++ Form1.cs | 20 ++++++ Program.cs | 22 ++++++ Properties/AssemblyInfo.cs | 36 ++++++++++ Properties/Resources.Designer.cs | 71 +++++++++++++++++++ Properties/Resources.resx | 117 +++++++++++++++++++++++++++++++ Properties/Settings.Designer.cs | 30 ++++++++ Properties/Settings.settings | 7 ++ 11 files changed, 454 insertions(+) create mode 100644 App.config create mode 100644 AwesomeEmailExtractor.csproj create mode 100644 AwesomeEmailExtractor.sln create mode 100644 Form1.Designer.cs create mode 100644 Form1.cs create mode 100644 Program.cs create mode 100644 Properties/AssemblyInfo.cs create mode 100644 Properties/Resources.Designer.cs create mode 100644 Properties/Resources.resx create mode 100644 Properties/Settings.Designer.cs create mode 100644 Properties/Settings.settings diff --git a/App.config b/App.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/AwesomeEmailExtractor.csproj b/AwesomeEmailExtractor.csproj new file mode 100644 index 0000000..c2d957c --- /dev/null +++ b/AwesomeEmailExtractor.csproj @@ -0,0 +1,80 @@ + + + + + Debug + AnyCPU + {FE70A2F9-D831-462E-8705-B14623544F1C} + WinExe + AwesomeEmailExtractor + AwesomeEmailExtractor + v4.7.2 + 512 + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + Form + + + Form1.cs + + + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + \ No newline at end of file diff --git a/AwesomeEmailExtractor.sln b/AwesomeEmailExtractor.sln new file mode 100644 index 0000000..8dacd76 --- /dev/null +++ b/AwesomeEmailExtractor.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.1.32421.90 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AwesomeEmailExtractor", "AwesomeEmailExtractor.csproj", "{FE70A2F9-D831-462E-8705-B14623544F1C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {FE70A2F9-D831-462E-8705-B14623544F1C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FE70A2F9-D831-462E-8705-B14623544F1C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FE70A2F9-D831-462E-8705-B14623544F1C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FE70A2F9-D831-462E-8705-B14623544F1C}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {FC73771A-0ACD-4A6D-8C37-DD61308BF996} + EndGlobalSection +EndGlobal diff --git a/Form1.Designer.cs b/Form1.Designer.cs new file mode 100644 index 0000000..12c6dea --- /dev/null +++ b/Form1.Designer.cs @@ -0,0 +1,40 @@ +namespace AwesomeEmailExtractor +{ + partial class Form1 + { + /// + /// Обязательная переменная конструктора. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Освободить все используемые ресурсы. + /// + /// истинно, если управляемый ресурс должен быть удален; иначе ложно. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Код, автоматически созданный конструктором форм Windows + + /// + /// Требуемый метод для поддержки конструктора — не изменяйте + /// содержимое этого метода с помощью редактора кода. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(800, 450); + this.Text = "Form1"; + } + + #endregion + } +} + diff --git a/Form1.cs b/Form1.cs new file mode 100644 index 0000000..8b3537b --- /dev/null +++ b/Form1.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace AwesomeEmailExtractor +{ + public partial class Form1 : Form + { + public Form1() + { + InitializeComponent(); + } + } +} diff --git a/Program.cs b/Program.cs new file mode 100644 index 0000000..24bb9e9 --- /dev/null +++ b/Program.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace AwesomeEmailExtractor +{ + internal static class Program + { + /// + /// Главная точка входа для приложения. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new Form1()); + } + } +} diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..b2fec4f --- /dev/null +++ b/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// Общие сведения об этой сборке предоставляются следующим набором +// набора атрибутов. Измените значения этих атрибутов для изменения сведений, +// связанных со сборкой. +[assembly: AssemblyTitle("AwesomeEmailExtractor")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("AwesomeEmailExtractor")] +[assembly: AssemblyCopyright("Copyright © 2022")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Установка значения False для параметра ComVisible делает типы в этой сборке невидимыми +// для компонентов COM. Если необходимо обратиться к типу в этой сборке через +// COM, следует установить атрибут ComVisible в TRUE для этого типа. +[assembly: ComVisible(false)] + +// Следующий GUID служит для идентификации библиотеки типов, если этот проект будет видимым для COM +[assembly: Guid("fe70a2f9-d831-462e-8705-b14623544f1c")] + +// Сведения о версии сборки состоят из указанных ниже четырех значений: +// +// Основной номер версии +// Дополнительный номер версии +// Номер сборки +// Редакция +// +// Можно задать все значения или принять номера сборки и редакции по умолчанию +// используя "*", как показано ниже: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Properties/Resources.Designer.cs b/Properties/Resources.Designer.cs new file mode 100644 index 0000000..882a29a --- /dev/null +++ b/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// Этот код создан программным средством. +// Версия среды выполнения: 4.0.30319.42000 +// +// Изменения в этом файле могут привести к неправильному поведению и будут утрачены, если +// код создан повторно. +// +//------------------------------------------------------------------------------ + +namespace AwesomeEmailExtractor.Properties +{ + + + /// + /// Класс ресурсов со строгим типом для поиска локализованных строк и пр. + /// + // Этот класс был автоматически создан при помощи StronglyTypedResourceBuilder + // класс с помощью таких средств, как ResGen или Visual Studio. + // Для добавления или удаления члена измените файл .ResX, а затем перезапустите ResGen + // с параметром /str или заново постройте свой VS-проект. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Возврат кэшированного экземпляра ResourceManager, используемого этим классом. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AwesomeEmailExtractor.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Переопределяет свойство CurrentUICulture текущего потока для всех + /// подстановки ресурсов с помощью этого класса ресурсов со строгим типом. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/Properties/Resources.resx b/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Properties/Settings.Designer.cs b/Properties/Settings.Designer.cs new file mode 100644 index 0000000..3bb49f5 --- /dev/null +++ b/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace AwesomeEmailExtractor.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/Properties/Settings.settings b/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + From a33fe8c83fb8ecc9b5707d2d9c1fb40e81f9f877 Mon Sep 17 00:00:00 2001 From: Maxim Slipenko Date: Sat, 14 May 2022 10:11:05 +0300 Subject: [PATCH 2/8] =?UTF-8?q?=D0=BC=D0=B5=D0=BD=D1=8F=D0=B5=D1=82=20?= =?UTF-8?q?=D0=BD=D0=B0=D0=B7=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20=D1=81=20For?= =?UTF-8?q?m1=20=D0=BD=D0=B0=20MainForm?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AwesomeEmailExtractor.csproj | 9 +- Form1.Designer.cs => MainForm.Designer.cs | 13 ++- Form1.cs => MainForm.cs | 4 +- MainForm.resx | 120 ++++++++++++++++++++++ Program.cs | 2 +- 5 files changed, 139 insertions(+), 9 deletions(-) rename Form1.Designer.cs => MainForm.Designer.cs (81%) rename Form1.cs => MainForm.cs (82%) create mode 100644 MainForm.resx diff --git a/AwesomeEmailExtractor.csproj b/AwesomeEmailExtractor.csproj index c2d957c..c86a1a0 100644 --- a/AwesomeEmailExtractor.csproj +++ b/AwesomeEmailExtractor.csproj @@ -46,14 +46,17 @@ - + Form - - Form1.cs + + MainForm.cs + + MainForm.cs + ResXFileCodeGenerator Resources.Designer.cs diff --git a/Form1.Designer.cs b/MainForm.Designer.cs similarity index 81% rename from Form1.Designer.cs rename to MainForm.Designer.cs index 12c6dea..879d452 100644 --- a/Form1.Designer.cs +++ b/MainForm.Designer.cs @@ -1,6 +1,6 @@ namespace AwesomeEmailExtractor { - partial class Form1 + partial class MainForm { /// /// Обязательная переменная конструктора. @@ -28,10 +28,17 @@ /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); + this.SuspendLayout(); + // + // MainForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(800, 450); - this.Text = "Form1"; + this.Name = "MainForm"; + this.Text = "Главная форма"; + this.ResumeLayout(false); + } #endregion diff --git a/Form1.cs b/MainForm.cs similarity index 82% rename from Form1.cs rename to MainForm.cs index 8b3537b..5354a22 100644 --- a/Form1.cs +++ b/MainForm.cs @@ -10,9 +10,9 @@ using System.Windows.Forms; namespace AwesomeEmailExtractor { - public partial class Form1 : Form + public partial class MainForm : Form { - public Form1() + public MainForm() { InitializeComponent(); } diff --git a/MainForm.resx b/MainForm.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/MainForm.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Program.cs b/Program.cs index 24bb9e9..a06ccf4 100644 --- a/Program.cs +++ b/Program.cs @@ -16,7 +16,7 @@ namespace AwesomeEmailExtractor { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new Form1()); + Application.Run(new MainForm()); } } } From 1aa90df970a11aa5906350a29130bb1bc6e8ae90 Mon Sep 17 00:00:00 2001 From: Maxim Slipenko Date: Sat, 14 May 2022 10:11:33 +0300 Subject: [PATCH 3/8] =?UTF-8?q?=D0=BC=D0=B5=D0=BD=D1=8F=D0=B5=D1=82=20Asse?= =?UTF-8?q?mblyVersion=20=D0=B8=20AssemblyFileVersion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Properties/AssemblyInfo.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index b2fec4f..76a0cd2 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // Можно задать все значения или принять номера сборки и редакции по умолчанию // используя "*", как показано ниже: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("0.1")] +[assembly: AssemblyFileVersion("0.1")] From 090126914be38d0adf814c6d207f2ae176b6cb8f Mon Sep 17 00:00:00 2001 From: Nikotro Date: Mon, 16 May 2022 15:01:45 +0300 Subject: [PATCH 4/8] =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D1=8F?= =?UTF-8?q?=D0=B5=D1=82=20=D0=B3=D0=BB=D0=B0=D0=B2=D0=BD=D0=BE=D0=B5=20?= =?UTF-8?q?=D0=BE=D0=BA=D0=BD=D0=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MainForm.Designer.cs | 128 ++++++++++++++++++++++++++++++++++++++++++- MainForm.resx | 6 ++ 2 files changed, 132 insertions(+), 2 deletions(-) diff --git a/MainForm.Designer.cs b/MainForm.Designer.cs index 879d452..1a9b505 100644 --- a/MainForm.Designer.cs +++ b/MainForm.Designer.cs @@ -28,20 +28,144 @@ /// private void InitializeComponent() { + this.listBox1 = new System.Windows.Forms.ListBox(); + this.richTextBox1 = new System.Windows.Forms.RichTextBox(); + this.button1 = new System.Windows.Forms.Button(); + this.label1 = new System.Windows.Forms.Label(); + this.statusStrip1 = new System.Windows.Forms.StatusStrip(); + this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel(); + this.menuStrip1 = new System.Windows.Forms.MenuStrip(); + this.файлToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.справкаToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.statusStrip1.SuspendLayout(); + this.menuStrip1.SuspendLayout(); this.SuspendLayout(); // + // listBox1 + // + this.listBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Right))); + this.listBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.listBox1.FormattingEnabled = true; + this.listBox1.ItemHeight = 20; + this.listBox1.Items.AddRange(new object[] { + "alice@example.com", + "bob@example.com"}); + this.listBox1.Location = new System.Drawing.Point(411, 32); + this.listBox1.Name = "listBox1"; + this.listBox1.Size = new System.Drawing.Size(225, 384); + this.listBox1.TabIndex = 0; + // + // richTextBox1 + // + this.richTextBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.richTextBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.richTextBox1.Location = new System.Drawing.Point(12, 32); + this.richTextBox1.Name = "richTextBox1"; + this.richTextBox1.Size = new System.Drawing.Size(393, 350); + this.richTextBox1.TabIndex = 1; + this.richTextBox1.Text = "Алиса (alice@example.com) послылает Бобу (bob@example.com) сообщение.\nАдрес bob@e" + + "xample.com Алиса нашла на сайте example.com"; + // + // button1 + // + this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.button1.Location = new System.Drawing.Point(12, 412); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(393, 24); + this.button1.TabIndex = 2; + this.button1.Text = "Выполнить"; + this.button1.UseVisualStyleBackColor = true; + // + // label1 + // + this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.label1.AutoSize = true; + this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.label1.Location = new System.Drawing.Point(12, 385); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(303, 24); + this.label1.TabIndex = 3; + this.label1.Text = "Количество e-mail-ов в тексте: 3"; + // + // statusStrip1 + // + this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.toolStripStatusLabel1}); + this.statusStrip1.Location = new System.Drawing.Point(0, 439); + this.statusStrip1.Name = "statusStrip1"; + this.statusStrip1.Size = new System.Drawing.Size(648, 22); + this.statusStrip1.TabIndex = 4; + this.statusStrip1.Text = "statusStrip1"; + // + // toolStripStatusLabel1 + // + this.toolStripStatusLabel1.Name = "toolStripStatusLabel1"; + this.toolStripStatusLabel1.Size = new System.Drawing.Size(42, 17); + this.toolStripStatusLabel1.Text = "Успех!"; + // + // menuStrip1 + // + this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.файлToolStripMenuItem, + this.справкаToolStripMenuItem}); + this.menuStrip1.Location = new System.Drawing.Point(0, 0); + this.menuStrip1.Name = "menuStrip1"; + this.menuStrip1.Size = new System.Drawing.Size(648, 24); + this.menuStrip1.TabIndex = 5; + this.menuStrip1.Text = "menuStrip1"; + // + // файлToolStripMenuItem + // + this.файлToolStripMenuItem.Name = "файлToolStripMenuItem"; + this.файлToolStripMenuItem.Size = new System.Drawing.Size(48, 20); + this.файлToolStripMenuItem.Text = "Файл"; + // + // справкаToolStripMenuItem + // + this.справкаToolStripMenuItem.Name = "справкаToolStripMenuItem"; + this.справкаToolStripMenuItem.Size = new System.Drawing.Size(65, 20); + this.справкаToolStripMenuItem.Text = "Справка"; + // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(800, 450); + this.ClientSize = new System.Drawing.Size(648, 461); + this.Controls.Add(this.listBox1); + this.Controls.Add(this.button1); + this.Controls.Add(this.statusStrip1); + this.Controls.Add(this.menuStrip1); + this.Controls.Add(this.label1); + this.Controls.Add(this.richTextBox1); + this.MainMenuStrip = this.menuStrip1; + this.MinimumSize = new System.Drawing.Size(642, 438); this.Name = "MainForm"; - this.Text = "Главная форма"; + this.Text = "Main Form"; + this.statusStrip1.ResumeLayout(false); + this.statusStrip1.PerformLayout(); + this.menuStrip1.ResumeLayout(false); + this.menuStrip1.PerformLayout(); this.ResumeLayout(false); + this.PerformLayout(); } #endregion + + private System.Windows.Forms.ListBox listBox1; + private System.Windows.Forms.RichTextBox richTextBox1; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.StatusStrip statusStrip1; + private System.Windows.Forms.MenuStrip menuStrip1; + private System.Windows.Forms.ToolStripMenuItem файлToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem справкаToolStripMenuItem; + private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1; } } diff --git a/MainForm.resx b/MainForm.resx index 1af7de1..6beaffa 100644 --- a/MainForm.resx +++ b/MainForm.resx @@ -117,4 +117,10 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 17, 17 + + + 133, 17 + \ No newline at end of file From 37d21c5f43c3f02de998600781c43aa7a76a302e Mon Sep 17 00:00:00 2001 From: Maxim Slipenko Date: Mon, 16 May 2022 15:14:20 +0300 Subject: [PATCH 5/8] =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D1=8F?= =?UTF-8?q?=D0=B5=D1=82=20=D0=B0=D0=BB=D0=B3=D0=BE=D1=80=D0=B8=D1=82=D0=BC?= =?UTF-8?q?=20=D0=B8=D0=B7=D0=B2=D0=BB=D0=B5=D1=87=D0=B5=D0=BD=D0=B8=D1=8F?= =?UTF-8?q?=20=D0=B0=D0=B4=D1=80=D0=B5=D1=81=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AwesomeEmailExtractor.csproj | 1 + ExtactEmailsAlgorithm.cs | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 ExtactEmailsAlgorithm.cs diff --git a/AwesomeEmailExtractor.csproj b/AwesomeEmailExtractor.csproj index c86a1a0..3ae428d 100644 --- a/AwesomeEmailExtractor.csproj +++ b/AwesomeEmailExtractor.csproj @@ -46,6 +46,7 @@ + Form diff --git a/ExtactEmailsAlgorithm.cs b/ExtactEmailsAlgorithm.cs new file mode 100644 index 0000000..4509198 --- /dev/null +++ b/ExtactEmailsAlgorithm.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Text.RegularExpressions; + +namespace AwesomeEmailExtractor +{ + internal class ExtactEmailsAlgorithm + { + public static int Extract(string inputText, out List uniqueEmails) + { + // Регулярное выражение для поиска почтовых адресов + string pattern = @"\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b"; + + // Находим каждый почтовый адрес в тексте + var matches = Regex.Matches(inputText, pattern, RegexOptions.IgnoreCase); + + // Получаем количество найденных адресов + int countMatches = matches.Count; + + // Получаем уникальные почтовые адреса + uniqueEmails = matches.Cast().Select(m => m.Value).Distinct().ToList(); + + return countMatches; + } + } +} From 878a1f26573bf50e4973f595af5412f613d151cc Mon Sep 17 00:00:00 2001 From: Maxim Slipenko Date: Mon, 16 May 2022 15:42:58 +0300 Subject: [PATCH 6/8] =?UTF-8?q?=D0=BD=D0=B0=D1=87=D0=B8=D0=BD=D0=B0=D0=B5?= =?UTF-8?q?=D1=82=20=D0=B8=D0=BD=D1=82=D0=B5=D0=B3=D1=80=D0=B8=D1=80=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D1=82=D1=8C=20=D0=B0=D0=BB=D0=B3=D0=BE=D1=80=D0=B8?= =?UTF-8?q?=D1=82=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - переименовывает элементы для улучшения DX - добавляет обработчик к executeButton --- MainForm.Designer.cs | 144 +++++++++++++++++++++---------------------- MainForm.cs | 4 ++ MainForm.resx | 2 +- 3 files changed, 77 insertions(+), 73 deletions(-) diff --git a/MainForm.Designer.cs b/MainForm.Designer.cs index 1a9b505..866012e 100644 --- a/MainForm.Designer.cs +++ b/MainForm.Designer.cs @@ -28,57 +28,58 @@ /// private void InitializeComponent() { - this.listBox1 = new System.Windows.Forms.ListBox(); - this.richTextBox1 = new System.Windows.Forms.RichTextBox(); - this.button1 = new System.Windows.Forms.Button(); + this.uniqueListBox = new System.Windows.Forms.ListBox(); + this.sourceRichTextBox = new System.Windows.Forms.RichTextBox(); + this.executeButton = new System.Windows.Forms.Button(); this.label1 = new System.Windows.Forms.Label(); - this.statusStrip1 = new System.Windows.Forms.StatusStrip(); - this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel(); + this.resultStatusStrip = new System.Windows.Forms.StatusStrip(); + this.toolStripStatusLabel = new System.Windows.Forms.ToolStripStatusLabel(); this.menuStrip1 = new System.Windows.Forms.MenuStrip(); - this.файлToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.справкаToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.statusStrip1.SuspendLayout(); + this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.resultStatusStrip.SuspendLayout(); this.menuStrip1.SuspendLayout(); this.SuspendLayout(); // - // listBox1 + // uniqueListBox // - this.listBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + this.uniqueListBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Right))); - this.listBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); - this.listBox1.FormattingEnabled = true; - this.listBox1.ItemHeight = 20; - this.listBox1.Items.AddRange(new object[] { + this.uniqueListBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.uniqueListBox.FormattingEnabled = true; + this.uniqueListBox.ItemHeight = 20; + this.uniqueListBox.Items.AddRange(new object[] { "alice@example.com", "bob@example.com"}); - this.listBox1.Location = new System.Drawing.Point(411, 32); - this.listBox1.Name = "listBox1"; - this.listBox1.Size = new System.Drawing.Size(225, 384); - this.listBox1.TabIndex = 0; + this.uniqueListBox.Location = new System.Drawing.Point(424, 32); + this.uniqueListBox.Name = "uniqueListBox"; + this.uniqueListBox.Size = new System.Drawing.Size(225, 304); + this.uniqueListBox.TabIndex = 0; // - // richTextBox1 + // sourceRichTextBox // - this.richTextBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + this.sourceRichTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.richTextBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); - this.richTextBox1.Location = new System.Drawing.Point(12, 32); - this.richTextBox1.Name = "richTextBox1"; - this.richTextBox1.Size = new System.Drawing.Size(393, 350); - this.richTextBox1.TabIndex = 1; - this.richTextBox1.Text = "Алиса (alice@example.com) послылает Бобу (bob@example.com) сообщение.\nАдрес bob@e" + + this.sourceRichTextBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.sourceRichTextBox.Location = new System.Drawing.Point(12, 32); + this.sourceRichTextBox.Name = "sourceRichTextBox"; + this.sourceRichTextBox.Size = new System.Drawing.Size(406, 288); + this.sourceRichTextBox.TabIndex = 1; + this.sourceRichTextBox.Text = "Алиса (alice@example.com) послылает Бобу (bob@example.com) сообщение.\nАдрес bob@e" + "xample.com Алиса нашла на сайте example.com"; // - // button1 + // executeButton // - this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + this.executeButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.button1.Location = new System.Drawing.Point(12, 412); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(393, 24); - this.button1.TabIndex = 2; - this.button1.Text = "Выполнить"; - this.button1.UseVisualStyleBackColor = true; + this.executeButton.Location = new System.Drawing.Point(12, 350); + this.executeButton.Name = "executeButton"; + this.executeButton.Size = new System.Drawing.Size(406, 24); + this.executeButton.TabIndex = 2; + this.executeButton.Text = "Выполнить"; + this.executeButton.UseVisualStyleBackColor = true; + this.executeButton.Click += new System.EventHandler(this.executeButton_Click); // // label1 // @@ -86,68 +87,67 @@ | System.Windows.Forms.AnchorStyles.Right))); this.label1.AutoSize = true; this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); - this.label1.Location = new System.Drawing.Point(12, 385); + this.label1.Location = new System.Drawing.Point(12, 323); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(303, 24); this.label1.TabIndex = 3; this.label1.Text = "Количество e-mail-ов в тексте: 3"; // - // statusStrip1 + // resultStatusStrip // - this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.toolStripStatusLabel1}); - this.statusStrip1.Location = new System.Drawing.Point(0, 439); - this.statusStrip1.Name = "statusStrip1"; - this.statusStrip1.Size = new System.Drawing.Size(648, 22); - this.statusStrip1.TabIndex = 4; - this.statusStrip1.Text = "statusStrip1"; + this.resultStatusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.toolStripStatusLabel}); + this.resultStatusStrip.Location = new System.Drawing.Point(0, 377); + this.resultStatusStrip.Name = "resultStatusStrip"; + this.resultStatusStrip.Size = new System.Drawing.Size(661, 22); + this.resultStatusStrip.TabIndex = 4; // - // toolStripStatusLabel1 + // toolStripStatusLabel // - this.toolStripStatusLabel1.Name = "toolStripStatusLabel1"; - this.toolStripStatusLabel1.Size = new System.Drawing.Size(42, 17); - this.toolStripStatusLabel1.Text = "Успех!"; + this.toolStripStatusLabel.Name = "toolStripStatusLabel"; + this.toolStripStatusLabel.Size = new System.Drawing.Size(42, 17); + this.toolStripStatusLabel.Text = "Успех!"; // // menuStrip1 // this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.файлToolStripMenuItem, - this.справкаToolStripMenuItem}); + this.fileToolStripMenuItem, + this.helpToolStripMenuItem}); this.menuStrip1.Location = new System.Drawing.Point(0, 0); this.menuStrip1.Name = "menuStrip1"; - this.menuStrip1.Size = new System.Drawing.Size(648, 24); + this.menuStrip1.Size = new System.Drawing.Size(661, 24); this.menuStrip1.TabIndex = 5; this.menuStrip1.Text = "menuStrip1"; // - // файлToolStripMenuItem + // fileToolStripMenuItem // - this.файлToolStripMenuItem.Name = "файлToolStripMenuItem"; - this.файлToolStripMenuItem.Size = new System.Drawing.Size(48, 20); - this.файлToolStripMenuItem.Text = "Файл"; + this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; + this.fileToolStripMenuItem.Size = new System.Drawing.Size(48, 20); + this.fileToolStripMenuItem.Text = "Файл"; // - // справкаToolStripMenuItem + // helpToolStripMenuItem // - this.справкаToolStripMenuItem.Name = "справкаToolStripMenuItem"; - this.справкаToolStripMenuItem.Size = new System.Drawing.Size(65, 20); - this.справкаToolStripMenuItem.Text = "Справка"; + this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; + this.helpToolStripMenuItem.Size = new System.Drawing.Size(65, 20); + this.helpToolStripMenuItem.Text = "Справка"; // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(648, 461); - this.Controls.Add(this.listBox1); - this.Controls.Add(this.button1); - this.Controls.Add(this.statusStrip1); + this.ClientSize = new System.Drawing.Size(661, 399); + this.Controls.Add(this.uniqueListBox); + this.Controls.Add(this.executeButton); + this.Controls.Add(this.resultStatusStrip); this.Controls.Add(this.menuStrip1); this.Controls.Add(this.label1); - this.Controls.Add(this.richTextBox1); + this.Controls.Add(this.sourceRichTextBox); this.MainMenuStrip = this.menuStrip1; this.MinimumSize = new System.Drawing.Size(642, 438); this.Name = "MainForm"; this.Text = "Main Form"; - this.statusStrip1.ResumeLayout(false); - this.statusStrip1.PerformLayout(); + this.resultStatusStrip.ResumeLayout(false); + this.resultStatusStrip.PerformLayout(); this.menuStrip1.ResumeLayout(false); this.menuStrip1.PerformLayout(); this.ResumeLayout(false); @@ -157,15 +157,15 @@ #endregion - private System.Windows.Forms.ListBox listBox1; - private System.Windows.Forms.RichTextBox richTextBox1; - private System.Windows.Forms.Button button1; + private System.Windows.Forms.ListBox uniqueListBox; + private System.Windows.Forms.RichTextBox sourceRichTextBox; + private System.Windows.Forms.Button executeButton; private System.Windows.Forms.Label label1; - private System.Windows.Forms.StatusStrip statusStrip1; + private System.Windows.Forms.StatusStrip resultStatusStrip; private System.Windows.Forms.MenuStrip menuStrip1; - private System.Windows.Forms.ToolStripMenuItem файлToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem справкаToolStripMenuItem; - private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1; + private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem helpToolStripMenuItem; + private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel; } } diff --git a/MainForm.cs b/MainForm.cs index 5354a22..dcf9355 100644 --- a/MainForm.cs +++ b/MainForm.cs @@ -16,5 +16,9 @@ namespace AwesomeEmailExtractor { InitializeComponent(); } + + private void executeButton_Click(object sender, EventArgs e) + { + } } } diff --git a/MainForm.resx b/MainForm.resx index 6beaffa..f9962f8 100644 --- a/MainForm.resx +++ b/MainForm.resx @@ -117,7 +117,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + 17, 17 From bc0d2385f7a3c8333ddc06aad7e677696f1408bd Mon Sep 17 00:00:00 2001 From: Maxim Slipenko Date: Mon, 16 May 2022 15:50:40 +0300 Subject: [PATCH 7/8] =?UTF-8?q?=D0=B8=D0=BD=D1=82=D0=B5=D0=B3=D1=80=D0=B8?= =?UTF-8?q?=D1=80=D1=83=D0=B5=D1=82=20=D0=B0=D0=BB=D0=B3=D0=BE=D1=80=D0=B8?= =?UTF-8?q?=D1=82=D0=BC=20=D0=B2=20=D0=BE=D0=B1=D1=80=D0=B0=D0=B1=D0=BE?= =?UTF-8?q?=D1=82=D1=87=D0=B8=D0=BA=20=D0=BA=D0=BD=D0=BE=D0=BF=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MainForm.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/MainForm.cs b/MainForm.cs index dcf9355..0397f71 100644 --- a/MainForm.cs +++ b/MainForm.cs @@ -19,6 +19,19 @@ namespace AwesomeEmailExtractor private void executeButton_Click(object sender, EventArgs e) { + // Объявляем список уникальных e-mail-ов + List uniqueEmails = new List(); + + // Получаем исходный текст из sourceRichTextBox + string sourceText = sourceRichTextBox.Text; + + // Вызываем метод для извлечения e-mail-ов + int count = ExtactEmailsAlgorithm.Extract(sourceText, out uniqueEmails); + + // Выводим результат + toolStripStatusLabel.Text = "Успех!"; + label1.Text = $"Количество e-mail-ов в тексте: {count}"; + uniqueListBox.DataSource = uniqueEmails; } } } From 3ed395fab81c99bb84a1391731910796fa70353c Mon Sep 17 00:00:00 2001 From: Maxim Slipenko Date: Mon, 16 May 2022 15:54:54 +0300 Subject: [PATCH 8/8] =?UTF-8?q?=D0=B4=D0=B5=D0=BB=D0=B0=D0=B5=D1=82=20?= =?UTF-8?q?=D0=BC=D0=B5=D0=BB=D0=BA=D0=B8=D0=B5=20=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - переименовывает label1 в resultCountLabel - добавляет очистку предыдущего результата перед вызовом алгоритма --- MainForm.Designer.cs | 24 ++++++++++++------------ MainForm.cs | 7 ++++++- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/MainForm.Designer.cs b/MainForm.Designer.cs index 866012e..8ce0ef9 100644 --- a/MainForm.Designer.cs +++ b/MainForm.Designer.cs @@ -31,7 +31,7 @@ this.uniqueListBox = new System.Windows.Forms.ListBox(); this.sourceRichTextBox = new System.Windows.Forms.RichTextBox(); this.executeButton = new System.Windows.Forms.Button(); - this.label1 = new System.Windows.Forms.Label(); + this.resultCountLabel = new System.Windows.Forms.Label(); this.resultStatusStrip = new System.Windows.Forms.StatusStrip(); this.toolStripStatusLabel = new System.Windows.Forms.ToolStripStatusLabel(); this.menuStrip1 = new System.Windows.Forms.MenuStrip(); @@ -81,17 +81,17 @@ this.executeButton.UseVisualStyleBackColor = true; this.executeButton.Click += new System.EventHandler(this.executeButton_Click); // - // label1 + // resultCountLabel // - this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + this.resultCountLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.label1.AutoSize = true; - this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); - this.label1.Location = new System.Drawing.Point(12, 323); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(303, 24); - this.label1.TabIndex = 3; - this.label1.Text = "Количество e-mail-ов в тексте: 3"; + this.resultCountLabel.AutoSize = true; + this.resultCountLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.resultCountLabel.Location = new System.Drawing.Point(12, 323); + this.resultCountLabel.Name = "resultCountLabel"; + this.resultCountLabel.Size = new System.Drawing.Size(303, 24); + this.resultCountLabel.TabIndex = 3; + this.resultCountLabel.Text = "Количество e-mail-ов в тексте: 3"; // // resultStatusStrip // @@ -140,7 +140,7 @@ this.Controls.Add(this.executeButton); this.Controls.Add(this.resultStatusStrip); this.Controls.Add(this.menuStrip1); - this.Controls.Add(this.label1); + this.Controls.Add(this.resultCountLabel); this.Controls.Add(this.sourceRichTextBox); this.MainMenuStrip = this.menuStrip1; this.MinimumSize = new System.Drawing.Size(642, 438); @@ -160,7 +160,7 @@ private System.Windows.Forms.ListBox uniqueListBox; private System.Windows.Forms.RichTextBox sourceRichTextBox; private System.Windows.Forms.Button executeButton; - private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label resultCountLabel; private System.Windows.Forms.StatusStrip resultStatusStrip; private System.Windows.Forms.MenuStrip menuStrip1; private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; diff --git a/MainForm.cs b/MainForm.cs index 0397f71..c66334d 100644 --- a/MainForm.cs +++ b/MainForm.cs @@ -19,6 +19,11 @@ namespace AwesomeEmailExtractor private void executeButton_Click(object sender, EventArgs e) { + // Чистим предыдущий результат + toolStripStatusLabel.Text = ""; + resultCountLabel.Text = ""; + uniqueListBox.DataSource = null; + // Объявляем список уникальных e-mail-ов List uniqueEmails = new List(); @@ -30,7 +35,7 @@ namespace AwesomeEmailExtractor // Выводим результат toolStripStatusLabel.Text = "Успех!"; - label1.Text = $"Количество e-mail-ов в тексте: {count}"; + resultCountLabel.Text = $"Количество e-mail-ов в тексте: {count}"; uniqueListBox.DataSource = uniqueEmails; } }