diff --git a/NavigateurWeb/App.config b/NavigateurWeb/App.config index 731f6de..e6ed8f7 100644 --- a/NavigateurWeb/App.config +++ b/NavigateurWeb/App.config @@ -1,6 +1,30 @@  + + +
+
+ + + + + + + + + + + + + + + + + http://google.be + + + \ No newline at end of file diff --git a/NavigateurWeb/Form1.Designer.cs b/NavigateurWeb/Form1.Designer.cs index 705f4f0..7eb50da 100644 --- a/NavigateurWeb/Form1.Designer.cs +++ b/NavigateurWeb/Form1.Designer.cs @@ -28,13 +28,212 @@ /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); + this.pnlNavigate = new System.Windows.Forms.Panel(); + this.panel1 = new System.Windows.Forms.Panel(); + this.webBrowser1 = new System.Windows.Forms.WebBrowser(); + this.txtBoxAddress = new System.Windows.Forms.TextBox(); + this.pbSendMail = new System.Windows.Forms.PictureBox(); + this.pbGo = new System.Windows.Forms.PictureBox(); + this.pbAddFav = new System.Windows.Forms.PictureBox(); + this.pbFav = new System.Windows.Forms.PictureBox(); + this.pbRefresh = new System.Windows.Forms.PictureBox(); + this.pbHome = new System.Windows.Forms.PictureBox(); + this.pbUp = new System.Windows.Forms.PictureBox(); + this.pbBack = new System.Windows.Forms.PictureBox(); + this.pnlNavigate.SuspendLayout(); + this.panel1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pbSendMail)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pbGo)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pbAddFav)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pbFav)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pbRefresh)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pbHome)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pbUp)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pbBack)).BeginInit(); + this.SuspendLayout(); + // + // pnlNavigate + // + this.pnlNavigate.Controls.Add(this.txtBoxAddress); + this.pnlNavigate.Controls.Add(this.pbGo); + this.pnlNavigate.Controls.Add(this.pbAddFav); + this.pnlNavigate.Controls.Add(this.pbFav); + this.pnlNavigate.Controls.Add(this.pbSendMail); + this.pnlNavigate.Controls.Add(this.pbRefresh); + this.pnlNavigate.Controls.Add(this.pbHome); + this.pnlNavigate.Controls.Add(this.pbUp); + this.pnlNavigate.Controls.Add(this.pbBack); + this.pnlNavigate.Dock = System.Windows.Forms.DockStyle.Top; + this.pnlNavigate.Location = new System.Drawing.Point(0, 0); + this.pnlNavigate.Name = "pnlNavigate"; + this.pnlNavigate.Size = new System.Drawing.Size(800, 24); + this.pnlNavigate.TabIndex = 1; + // + // panel1 + // + this.panel1.Controls.Add(this.webBrowser1); + this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel1.Location = new System.Drawing.Point(0, 24); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(800, 426); + this.panel1.TabIndex = 2; + // + // webBrowser1 + // + this.webBrowser1.Dock = System.Windows.Forms.DockStyle.Fill; + this.webBrowser1.Location = new System.Drawing.Point(0, 0); + this.webBrowser1.MinimumSize = new System.Drawing.Size(20, 20); + this.webBrowser1.Name = "webBrowser1"; + this.webBrowser1.Size = new System.Drawing.Size(800, 426); + this.webBrowser1.TabIndex = 0; + this.webBrowser1.Navigated += new System.Windows.Forms.WebBrowserNavigatedEventHandler(this.webBrowser1_Navigated); + // + // txtBoxAddress + // + this.txtBoxAddress.Dock = System.Windows.Forms.DockStyle.Fill; + this.txtBoxAddress.Location = new System.Drawing.Point(96, 0); + this.txtBoxAddress.Name = "txtBoxAddress"; + this.txtBoxAddress.Size = new System.Drawing.Size(608, 20); + this.txtBoxAddress.TabIndex = 4; + this.txtBoxAddress.KeyUp += new System.Windows.Forms.KeyEventHandler(this.txtBoxAddress_KeyUp); + // + // pbSendMail + // + this.pbSendMail.Dock = System.Windows.Forms.DockStyle.Right; + this.pbSendMail.Image = global::NavigateurWeb.Properties.Resources.index1; + this.pbSendMail.Location = new System.Drawing.Point(776, 0); + this.pbSendMail.Name = "pbSendMail"; + this.pbSendMail.Size = new System.Drawing.Size(24, 24); + this.pbSendMail.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pbSendMail.TabIndex = 8; + this.pbSendMail.TabStop = false; + this.pbSendMail.Click += new System.EventHandler(this.pbSendMail_Click); + // + // pbGo + // + this.pbGo.Dock = System.Windows.Forms.DockStyle.Right; + this.pbGo.Image = global::NavigateurWeb.Properties.Resources.fleche_droite_318_113460; + this.pbGo.Location = new System.Drawing.Point(704, 0); + this.pbGo.Name = "pbGo"; + this.pbGo.Size = new System.Drawing.Size(24, 24); + this.pbGo.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pbGo.TabIndex = 5; + this.pbGo.TabStop = false; + this.pbGo.Click += new System.EventHandler(this.pbGo_Click); + // + // pbAddFav + // + this.pbAddFav.Dock = System.Windows.Forms.DockStyle.Right; + this.pbAddFav.Image = global::NavigateurWeb.Properties.Resources.add_to_favorites_icon; + this.pbAddFav.Location = new System.Drawing.Point(728, 0); + this.pbAddFav.Name = "pbAddFav"; + this.pbAddFav.Size = new System.Drawing.Size(24, 24); + this.pbAddFav.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pbAddFav.TabIndex = 7; + this.pbAddFav.TabStop = false; + this.pbAddFav.Click += new System.EventHandler(this.pbAddFav_Click); + // + // pbFav + // + this.pbFav.Dock = System.Windows.Forms.DockStyle.Right; + this.pbFav.Image = global::NavigateurWeb.Properties.Resources._1331065085; + this.pbFav.Location = new System.Drawing.Point(752, 0); + this.pbFav.Name = "pbFav"; + this.pbFav.Size = new System.Drawing.Size(24, 24); + this.pbFav.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pbFav.TabIndex = 6; + this.pbFav.TabStop = false; + this.pbFav.Click += new System.EventHandler(this.pbFav_Click); + // + // pbRefresh + // + this.pbRefresh.Dock = System.Windows.Forms.DockStyle.Left; + this.pbRefresh.Image = global::NavigateurWeb.Properties.Resources._2000px_Go_home_svg; + this.pbRefresh.Location = new System.Drawing.Point(72, 0); + this.pbRefresh.Name = "pbRefresh"; + this.pbRefresh.Size = new System.Drawing.Size(24, 24); + this.pbRefresh.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pbRefresh.TabIndex = 3; + this.pbRefresh.TabStop = false; + this.pbRefresh.Click += new System.EventHandler(this.pbRefresh_Click); + // + // pbHome + // + this.pbHome.Dock = System.Windows.Forms.DockStyle.Left; + this.pbHome.Image = global::NavigateurWeb.Properties.Resources._15460_200; + this.pbHome.Location = new System.Drawing.Point(48, 0); + this.pbHome.Name = "pbHome"; + this.pbHome.Size = new System.Drawing.Size(24, 24); + this.pbHome.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pbHome.TabIndex = 2; + this.pbHome.TabStop = false; + this.pbHome.Click += new System.EventHandler(this.pbHome_Click); + // + // pbUp + // + this.pbUp.Dock = System.Windows.Forms.DockStyle.Left; + this.pbUp.Image = global::NavigateurWeb.Properties.Resources.forw; + this.pbUp.InitialImage = global::NavigateurWeb.Properties.Resources.forw; + this.pbUp.Location = new System.Drawing.Point(24, 0); + this.pbUp.Name = "pbUp"; + this.pbUp.Size = new System.Drawing.Size(24, 24); + this.pbUp.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pbUp.TabIndex = 1; + this.pbUp.TabStop = false; + this.pbUp.Click += new System.EventHandler(this.pbUp_Click); + // + // pbBack + // + this.pbBack.Dock = System.Windows.Forms.DockStyle.Left; + this.pbBack.Image = global::NavigateurWeb.Properties.Resources.go_back_icon; + this.pbBack.Location = new System.Drawing.Point(0, 0); + this.pbBack.Name = "pbBack"; + this.pbBack.Size = new System.Drawing.Size(24, 24); + this.pbBack.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pbBack.TabIndex = 0; + this.pbBack.TabStop = false; + this.pbBack.Click += new System.EventHandler(this.pbBack_Click); + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(800, 450); + this.Controls.Add(this.panel1); + this.Controls.Add(this.pnlNavigate); + this.Name = "Form1"; this.Text = "Form1"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing); + this.Load += new System.EventHandler(this.Form1_Load); + this.pnlNavigate.ResumeLayout(false); + this.pnlNavigate.PerformLayout(); + this.panel1.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.pbSendMail)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pbGo)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pbAddFav)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pbFav)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pbRefresh)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pbHome)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pbUp)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pbBack)).EndInit(); + this.ResumeLayout(false); + } #endregion + + private System.Windows.Forms.Panel pnlNavigate; + private System.Windows.Forms.TextBox txtBoxAddress; + private System.Windows.Forms.PictureBox pbRefresh; + private System.Windows.Forms.PictureBox pbHome; + private System.Windows.Forms.PictureBox pbUp; + private System.Windows.Forms.PictureBox pbBack; + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.WebBrowser webBrowser1; + private System.Windows.Forms.PictureBox pbGo; + private System.Windows.Forms.PictureBox pbFav; + private System.Windows.Forms.PictureBox pbAddFav; + private System.Windows.Forms.PictureBox pbSendMail; } } diff --git a/NavigateurWeb/Form1.cs b/NavigateurWeb/Form1.cs index de322f4..37e2737 100644 --- a/NavigateurWeb/Form1.cs +++ b/NavigateurWeb/Form1.cs @@ -7,14 +7,138 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; +using System.IO; namespace NavigateurWeb { public partial class Form1 : Form { + ContextMenuStrip fav = new ContextMenuStrip(); public Form1() { InitializeComponent(); + if(File.Exists("fav.txt")) + { + ReadFav(); + } + fav.ItemClicked += new ToolStripItemClickedEventHandler(this.fav_ItemClicked); + } + + public void loadUrl() + { + String address = txtBoxAddress.Text; + if (String.IsNullOrEmpty(address)) return; + if (address.Equals("about:blank")) return; + if (!address.StartsWith("http://") && + !address.StartsWith("https://")) + { + address = "http://" + address; + } + try + { + webBrowser1.Navigate(new Uri(address)); + } + catch (System.UriFormatException) + { + return; + } + } + + + + private void pbGo_Click(object sender, EventArgs e) + { + loadUrl(); + } + + private void pbRefresh_Click(object sender, EventArgs e) + { + txtBoxAddress.Text = Settings1.Default.home; + loadUrl(); + } + + private void pbBack_Click(object sender, EventArgs e) + { + webBrowser1.GoBack(); + txtBoxAddress.Text = webBrowser1.Url.ToString(); + } + + private void pbUp_Click(object sender, EventArgs e) + { + webBrowser1.GoForward(); + txtBoxAddress.Text = webBrowser1.Url.ToString(); + } + + private void pbHome_Click(object sender, EventArgs e) + { + webBrowser1.Refresh(); + txtBoxAddress.Text = webBrowser1.Url.ToString(); + } + + private void txtBoxAddress_KeyUp(object sender, KeyEventArgs e) + { + if (e.KeyCode == Keys.Enter) + loadUrl(); + } + + private void pbFav_Click(object sender, EventArgs e) + { + fav.Show(MousePosition); + } + + private void Form1_Load(object sender, EventArgs e) + { + + } + + private void Form1_FormClosing(object sender, FormClosingEventArgs e) + { + WriteFav(); + MailSettings.Default.Save(); + Settings1.Default.Save(); + } + public void WriteFav() + { + using (StreamWriter sw = new StreamWriter("fav.txt")) + { + foreach(ToolStripMenuItem favText in fav.Items) + { + sw.WriteLine(favText.ToString()); + } + } + } + public void ReadFav() + { + fav.Items.Clear(); + using (StreamReader sr = new StreamReader("fav.txt")) + { + string favText; + while ((favText = sr.ReadLine()) != null) + { + fav.Items.Add(favText.ToString()); + } + } + } + + private void pbAddFav_Click(object sender, EventArgs e) + { + fav.Items.Add(txtBoxAddress.Text); + } + private void fav_ItemClicked(Object sender, ToolStripItemClickedEventArgs e) + { + txtBoxAddress.Text = e.ClickedItem.Text; + loadUrl(); + } + + private void webBrowser1_Navigated(object sender, WebBrowserNavigatedEventArgs e) + { + txtBoxAddress.Text = webBrowser1.Url.ToString() ; + } + + private void pbSendMail_Click(object sender, EventArgs e) + { + MailTo mail = new MailTo(); + mail.ShowDialog(); } } } diff --git a/NavigateurWeb/Form1.resx b/NavigateurWeb/Form1.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/NavigateurWeb/Form1.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/NavigateurWeb/MailSettings.Designer.cs b/NavigateurWeb/MailSettings.Designer.cs new file mode 100644 index 0000000..9f7271a --- /dev/null +++ b/NavigateurWeb/MailSettings.Designer.cs @@ -0,0 +1,62 @@ +//------------------------------------------------------------------------------ +// +// Ce code a été généré par un outil. +// Version du runtime :4.0.30319.42000 +// +// Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si +// le code est régénéré. +// +//------------------------------------------------------------------------------ + +namespace NavigateurWeb { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.7.0.0")] + internal sealed partial class MailSettings : global::System.Configuration.ApplicationSettingsBase { + + private static MailSettings defaultInstance = ((MailSettings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new MailSettings()))); + + public static MailSettings Default { + get { + return defaultInstance; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string smtpServer { + get { + return ((string)(this["smtpServer"])); + } + set { + this["smtpServer"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string password { + get { + return ((string)(this["password"])); + } + set { + this["password"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string mail { + get { + return ((string)(this["mail"])); + } + set { + this["mail"] = value; + } + } + } +} diff --git a/NavigateurWeb/MailSettings.settings b/NavigateurWeb/MailSettings.settings new file mode 100644 index 0000000..0332017 --- /dev/null +++ b/NavigateurWeb/MailSettings.settings @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/NavigateurWeb/MailTo.Designer.cs b/NavigateurWeb/MailTo.Designer.cs new file mode 100644 index 0000000..68ea1a9 --- /dev/null +++ b/NavigateurWeb/MailTo.Designer.cs @@ -0,0 +1,264 @@ +namespace NavigateurWeb +{ + partial class MailTo + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.txt_subject = new System.Windows.Forms.TextBox(); + this.label5 = new System.Windows.Forms.Label(); + this.btnSend = new System.Windows.Forms.Button(); + this.label4 = new System.Windows.Forms.Label(); + this.richTextBox1 = new System.Windows.Forms.RichTextBox(); + this.txt_from = new System.Windows.Forms.TextBox(); + this.txt_to = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); + this.txt_password = new System.Windows.Forms.TextBox(); + this.label3 = new System.Windows.Forms.Label(); + this.label6 = new System.Windows.Forms.Label(); + this.txt_smtpserver = new System.Windows.Forms.TextBox(); + this.dgvAtach = new System.Windows.Forms.DataGridView(); + this.pbDellAtach = new System.Windows.Forms.PictureBox(); + this.pbAddAtach = new System.Windows.Forms.PictureBox(); + this.FilePath = new System.Windows.Forms.DataGridViewTextBoxColumn(); + ((System.ComponentModel.ISupportInitialize)(this.dgvAtach)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pbDellAtach)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pbAddAtach)).BeginInit(); + this.SuspendLayout(); + // + // txt_subject + // + this.txt_subject.Location = new System.Drawing.Point(151, 154); + this.txt_subject.Name = "txt_subject"; + this.txt_subject.Size = new System.Drawing.Size(254, 20); + this.txt_subject.TabIndex = 23; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label5.Location = new System.Drawing.Point(12, 154); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(63, 20); + this.label5.TabIndex = 22; + this.label5.Text = "Subject"; + // + // btnSend + // + this.btnSend.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F); + this.btnSend.Location = new System.Drawing.Point(477, 405); + this.btnSend.Name = "btnSend"; + this.btnSend.Size = new System.Drawing.Size(133, 33); + this.btnSend.TabIndex = 21; + this.btnSend.Text = "Send"; + this.btnSend.UseVisualStyleBackColor = true; + this.btnSend.Click += new System.EventHandler(this.btnSend_Click_1); + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label4.Location = new System.Drawing.Point(12, 182); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(74, 20); + this.label4.TabIndex = 20; + this.label4.Text = "Message"; + // + // richTextBox1 + // + this.richTextBox1.Location = new System.Drawing.Point(16, 204); + this.richTextBox1.Name = "richTextBox1"; + this.richTextBox1.Size = new System.Drawing.Size(783, 194); + this.richTextBox1.TabIndex = 19; + this.richTextBox1.Text = ""; + // + // txt_from + // + this.txt_from.Location = new System.Drawing.Point(151, 53); + this.txt_from.Name = "txt_from"; + this.txt_from.Size = new System.Drawing.Size(254, 20); + this.txt_from.TabIndex = 17; + // + // txt_to + // + this.txt_to.Location = new System.Drawing.Point(151, 9); + this.txt_to.Name = "txt_to"; + this.txt_to.Size = new System.Drawing.Size(254, 20); + this.txt_to.TabIndex = 16; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label2.Location = new System.Drawing.Point(12, 51); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(129, 20); + this.label2.TabIndex = 14; + this.label2.Text = "From / your email"; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label1.Location = new System.Drawing.Point(12, 9); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(27, 20); + this.label1.TabIndex = 13; + this.label1.Text = "To"; + // + // txt_password + // + this.txt_password.Location = new System.Drawing.Point(151, 79); + this.txt_password.Name = "txt_password"; + this.txt_password.Size = new System.Drawing.Size(254, 20); + this.txt_password.TabIndex = 18; + this.txt_password.UseSystemPasswordChar = true; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label3.Location = new System.Drawing.Point(12, 80); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(78, 20); + this.label3.TabIndex = 15; + this.label3.Text = "Password"; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label6.Location = new System.Drawing.Point(12, 112); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(94, 20); + this.label6.TabIndex = 24; + this.label6.Text = "Smtp server"; + // + // txt_smtpserver + // + this.txt_smtpserver.Location = new System.Drawing.Point(151, 112); + this.txt_smtpserver.Name = "txt_smtpserver"; + this.txt_smtpserver.Size = new System.Drawing.Size(254, 20); + this.txt_smtpserver.TabIndex = 25; + // + // dgvAtach + // + this.dgvAtach.AllowUserToAddRows = false; + this.dgvAtach.AllowUserToDeleteRows = false; + this.dgvAtach.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dgvAtach.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.FilePath}); + this.dgvAtach.Location = new System.Drawing.Point(439, 37); + this.dgvAtach.Name = "dgvAtach"; + this.dgvAtach.ReadOnly = true; + this.dgvAtach.RowHeadersVisible = false; + this.dgvAtach.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.dgvAtach.Size = new System.Drawing.Size(360, 137); + this.dgvAtach.TabIndex = 26; + // + // pbDellAtach + // + this.pbDellAtach.Image = global::NavigateurWeb.Properties.Resources.trash; + this.pbDellAtach.Location = new System.Drawing.Point(774, 7); + this.pbDellAtach.Name = "pbDellAtach"; + this.pbDellAtach.Size = new System.Drawing.Size(25, 22); + this.pbDellAtach.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pbDellAtach.TabIndex = 28; + this.pbDellAtach.TabStop = false; + this.pbDellAtach.Click += new System.EventHandler(this.pbDellAtach_Click); + // + // pbAddAtach + // + this.pbAddAtach.Image = global::NavigateurWeb.Properties.Resources.UI_07_512; + this.pbAddAtach.Location = new System.Drawing.Point(744, 9); + this.pbAddAtach.Name = "pbAddAtach"; + this.pbAddAtach.Size = new System.Drawing.Size(25, 22); + this.pbAddAtach.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.pbAddAtach.TabIndex = 27; + this.pbAddAtach.TabStop = false; + this.pbAddAtach.Click += new System.EventHandler(this.pbAddAtach_Click); + // + // FilePath + // + this.FilePath.DataPropertyName = "FilePath"; + this.FilePath.Frozen = true; + this.FilePath.HeaderText = "FilePath"; + this.FilePath.Name = "FilePath"; + this.FilePath.ReadOnly = true; + this.FilePath.Width = 300; + // + // MailTo + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(811, 450); + this.Controls.Add(this.pbDellAtach); + this.Controls.Add(this.pbAddAtach); + this.Controls.Add(this.dgvAtach); + this.Controls.Add(this.txt_smtpserver); + this.Controls.Add(this.label6); + this.Controls.Add(this.txt_subject); + this.Controls.Add(this.label5); + this.Controls.Add(this.btnSend); + this.Controls.Add(this.label4); + this.Controls.Add(this.richTextBox1); + this.Controls.Add(this.txt_password); + this.Controls.Add(this.txt_from); + this.Controls.Add(this.txt_to); + this.Controls.Add(this.label3); + this.Controls.Add(this.label2); + this.Controls.Add(this.label1); + this.Name = "MailTo"; + this.Text = "MailTo"; + ((System.ComponentModel.ISupportInitialize)(this.dgvAtach)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pbDellAtach)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pbAddAtach)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + private System.Windows.Forms.TextBox txt_subject; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.Button btnSend; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.RichTextBox richTextBox1; + private System.Windows.Forms.TextBox txt_from; + private System.Windows.Forms.TextBox txt_to; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox txt_password; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.TextBox txt_smtpserver; + private System.Windows.Forms.DataGridView dgvAtach; + private System.Windows.Forms.PictureBox pbAddAtach; + private System.Windows.Forms.PictureBox pbDellAtach; + private System.Windows.Forms.DataGridViewTextBoxColumn FilePath; + } +} \ No newline at end of file diff --git a/NavigateurWeb/MailTo.cs b/NavigateurWeb/MailTo.cs new file mode 100644 index 0000000..c5962aa --- /dev/null +++ b/NavigateurWeb/MailTo.cs @@ -0,0 +1,77 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Net.Mail; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace NavigateurWeb +{ + public partial class MailTo : Form + { + public MailTo() + { + InitializeComponent(); + txt_from.Text= MailSettings.Default.mail; + txt_password.Text=MailSettings.Default.password; + txt_smtpserver.Text = MailSettings.Default.smtpServer; + + } + + private void btnSend_Click(object sender, EventArgs e) + { + + } + + private void btnSend_Click_1(object sender, EventArgs e) + { + MailMessage message = new MailMessage(); + SmtpClient SmtpServer = new SmtpClient(txt_smtpserver.Text); + MailSettings.Default.smtpServer = txt_smtpserver.Text; + message.From = new MailAddress(txt_from.Text); + message.To.Add(txt_to.Text); + message.Subject = txt_subject.Text; + message.Body = richTextBox1.Text; + SmtpServer.Port = 587; + SmtpServer.Credentials = new System.Net.NetworkCredential(txt_from.Text, txt_password.Text); + MailSettings.Default.mail = txt_from.Text; + MailSettings.Default.password = txt_password.Text; + SmtpServer.EnableSsl = true; + foreach (DataGridViewRow row in dgvAtach.Rows) + { + Attachment attachment = new Attachment(row.Cells[0].Value.ToString()); + Console.WriteLine(row.Cells[0].Value.ToString()); + message.Attachments.Add(attachment); + } + SmtpServer.Send(message); + + } + + private void pbAddAtach_Click(object sender, EventArgs e) + { + OpenFileDialog ofd; + ofd = new OpenFileDialog(); + ofd.CheckFileExists = true; + ofd.CheckPathExists = true; + ofd.Title = "Attachement"; + if (ofd.ShowDialog() == DialogResult.OK) + { + dgvAtach.Rows.Add(ofd.InitialDirectory + ofd.FileName); + } + } + + private void pbDellAtach_Click(object sender, EventArgs e) + { + + foreach (DataGridViewRow row in dgvAtach.SelectedRows) + { + dgvAtach.Rows.RemoveAt(row.Index); + } + + } + } +} diff --git a/NavigateurWeb/MailTo.resx b/NavigateurWeb/MailTo.resx new file mode 100644 index 0000000..1949b94 --- /dev/null +++ b/NavigateurWeb/MailTo.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + True + + \ No newline at end of file diff --git a/NavigateurWeb/Navigateur.cs b/NavigateurWeb/Navigateur.cs new file mode 100644 index 0000000..454e2d3 --- /dev/null +++ b/NavigateurWeb/Navigateur.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace NavigateurWeb +{ + class Navigateur + { + + } +} diff --git a/NavigateurWeb/NavigateurWeb.csproj b/NavigateurWeb/NavigateurWeb.csproj index d0fb5ab..945dc0c 100644 --- a/NavigateurWeb/NavigateurWeb.csproj +++ b/NavigateurWeb/NavigateurWeb.csproj @@ -51,8 +51,31 @@ Form1.cs + + True + True + MailSettings.settings + + + Form + + + MailTo.cs + + + + True + True + Settings1.settings + + + Form1.cs + + + MailTo.cs + ResXFileCodeGenerator Resources.Designer.cs @@ -61,7 +84,12 @@ True Resources.resx + True + + SettingsSingleFileGenerator + MailSettings.Designer.cs + SettingsSingleFileGenerator Settings.Designer.cs @@ -71,9 +99,46 @@ Settings.settings True + + SettingsSingleFileGenerator + Settings1.Designer.cs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/NavigateurWeb/Properties/Resources.Designer.cs b/NavigateurWeb/Properties/Resources.Designer.cs index 5930c8e..e9445b5 100644 --- a/NavigateurWeb/Properties/Resources.Designer.cs +++ b/NavigateurWeb/Properties/Resources.Designer.cs @@ -8,10 +8,10 @@ // //------------------------------------------------------------------------------ -namespace NavigateurWeb.Properties -{ - - +namespace NavigateurWeb.Properties { + using System; + + /// /// Une classe de ressource fortement typée destinée, entre autres, à la consultation des chaînes localisées. /// @@ -19,53 +19,155 @@ namespace NavigateurWeb.Properties // à l'aide d'un outil, tel que ResGen ou Visual Studio. // Pour ajouter ou supprimer un membre, modifiez votre fichier .ResX, puis réexécutez ResGen // avec l'option /str ou régénérez votre projet VS. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources - { - + 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() - { + internal Resources() { } - + /// /// Retourne l'instance ResourceManager mise en cache utilisée par cette classe. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager - { - get - { - if ((resourceMan == null)) - { + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("NavigateurWeb.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } - + /// /// Remplace la propriété CurrentUICulture du thread actuel pour toutes /// les recherches de ressources à l'aide de cette classe de ressource fortement typée. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture - { - get - { + internal static global::System.Globalization.CultureInfo Culture { + get { return resourceCulture; } - set - { + set { resourceCulture = value; } } + + /// + /// Recherche une ressource localisée de type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap _1331065085 { + get { + object obj = ResourceManager.GetObject("1331065085", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Recherche une ressource localisée de type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap _15460_200 { + get { + object obj = ResourceManager.GetObject("15460-200", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Recherche une ressource localisée de type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap _2000px_Go_home_svg { + get { + object obj = ResourceManager.GetObject("2000px-Go-home.svg", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Recherche une ressource localisée de type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap add_to_favorites_icon { + get { + object obj = ResourceManager.GetObject("add-to-favorites-icon", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Recherche une ressource localisée de type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap fleche_droite_318_113460 { + get { + object obj = ResourceManager.GetObject("fleche-droite_318-113460", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Recherche une ressource localisée de type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap forw { + get { + object obj = ResourceManager.GetObject("forw", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Recherche une ressource localisée de type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap go_back_icon { + get { + object obj = ResourceManager.GetObject("go-back-icon", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Recherche une ressource localisée de type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap index { + get { + object obj = ResourceManager.GetObject("index", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Recherche une ressource localisée de type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap index1 { + get { + object obj = ResourceManager.GetObject("index1", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Recherche une ressource localisée de type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap trash { + get { + object obj = ResourceManager.GetObject("trash", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Recherche une ressource localisée de type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap UI_07_512 { + get { + object obj = ResourceManager.GetObject("UI-07-512", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } } } diff --git a/NavigateurWeb/Properties/Resources.resx b/NavigateurWeb/Properties/Resources.resx index af7dbeb..6390d67 100644 --- a/NavigateurWeb/Properties/Resources.resx +++ b/NavigateurWeb/Properties/Resources.resx @@ -46,7 +46,7 @@ mimetype: application/x-microsoft.net.object.binary.base64 value : The object must be serialized with - : System.Serialization.Formatters.Binary.BinaryFormatter + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.soap.base64 @@ -60,6 +60,7 @@ : and then encoded with base64 encoding. --> + @@ -68,9 +69,10 @@ - + + @@ -85,9 +87,10 @@ - + + @@ -109,9 +112,43 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ..\logo\2000px-Go-home.svg.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\logo\15460-200.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\logo\index.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\logo\go-back-icon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\logo\forw.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\logo\UI-07-512.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\logo\1331065085.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\logo\index.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\logo\fleche-droite_318-113460.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\logo\add-to-favorites-icon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\logo\trash.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/NavigateurWeb/Settings1.Designer.cs b/NavigateurWeb/Settings1.Designer.cs new file mode 100644 index 0000000..97189a2 --- /dev/null +++ b/NavigateurWeb/Settings1.Designer.cs @@ -0,0 +1,38 @@ +//------------------------------------------------------------------------------ +// +// Ce code a été généré par un outil. +// Version du runtime :4.0.30319.42000 +// +// Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si +// le code est régénéré. +// +//------------------------------------------------------------------------------ + +namespace NavigateurWeb { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.7.0.0")] + internal sealed partial class Settings1 : global::System.Configuration.ApplicationSettingsBase { + + private static Settings1 defaultInstance = ((Settings1)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings1()))); + + public static Settings1 Default { + get { + return defaultInstance; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("http://google.be")] + public string home { + get { + return ((string)(this["home"])); + } + set { + this["home"] = value; + } + } + } +} diff --git a/NavigateurWeb/Settings1.settings b/NavigateurWeb/Settings1.settings new file mode 100644 index 0000000..4123d17 --- /dev/null +++ b/NavigateurWeb/Settings1.settings @@ -0,0 +1,9 @@ + + + + + + http://google.be + + + \ No newline at end of file diff --git a/NavigateurWeb/logo/1331065085.jpg b/NavigateurWeb/logo/1331065085.jpg new file mode 100644 index 0000000..ff65157 Binary files /dev/null and b/NavigateurWeb/logo/1331065085.jpg differ diff --git a/NavigateurWeb/logo/15460-200.png b/NavigateurWeb/logo/15460-200.png new file mode 100644 index 0000000..54a8c13 Binary files /dev/null and b/NavigateurWeb/logo/15460-200.png differ diff --git a/NavigateurWeb/logo/2000px-Go-home.svg.png b/NavigateurWeb/logo/2000px-Go-home.svg.png new file mode 100644 index 0000000..f71f4af Binary files /dev/null and b/NavigateurWeb/logo/2000px-Go-home.svg.png differ diff --git a/NavigateurWeb/logo/UI-07-512.png b/NavigateurWeb/logo/UI-07-512.png new file mode 100644 index 0000000..897efa8 Binary files /dev/null and b/NavigateurWeb/logo/UI-07-512.png differ diff --git a/NavigateurWeb/logo/add-to-favorites-icon.png b/NavigateurWeb/logo/add-to-favorites-icon.png new file mode 100644 index 0000000..95f4126 Binary files /dev/null and b/NavigateurWeb/logo/add-to-favorites-icon.png differ diff --git a/NavigateurWeb/logo/fleche-droite_318-113460.jpg b/NavigateurWeb/logo/fleche-droite_318-113460.jpg new file mode 100644 index 0000000..eab4b22 Binary files /dev/null and b/NavigateurWeb/logo/fleche-droite_318-113460.jpg differ diff --git a/NavigateurWeb/logo/forw.jpg b/NavigateurWeb/logo/forw.jpg new file mode 100644 index 0000000..390646c Binary files /dev/null and b/NavigateurWeb/logo/forw.jpg differ diff --git a/NavigateurWeb/logo/go-back-icon.png b/NavigateurWeb/logo/go-back-icon.png new file mode 100644 index 0000000..d11ea3d Binary files /dev/null and b/NavigateurWeb/logo/go-back-icon.png differ diff --git a/NavigateurWeb/logo/index.jpg b/NavigateurWeb/logo/index.jpg new file mode 100644 index 0000000..b6c490a Binary files /dev/null and b/NavigateurWeb/logo/index.jpg differ diff --git a/NavigateurWeb/logo/index.png b/NavigateurWeb/logo/index.png new file mode 100644 index 0000000..f422f6c Binary files /dev/null and b/NavigateurWeb/logo/index.png differ diff --git a/NavigateurWeb/logo/trash.png b/NavigateurWeb/logo/trash.png new file mode 100644 index 0000000..08f5165 Binary files /dev/null and b/NavigateurWeb/logo/trash.png differ