2
0
deadmoon 3 жил өмнө
parent
commit
300423eeb0

+ 1 - 0
CONFS.md

@@ -40,6 +40,7 @@
 * Startup items tool (```startup```)
 * Cleaner utility (```cleaner```)
 * Integrator tool (```integrator```)
+* Pinger tool (```pinger```)
 
 #### Examples ####
 

+ 1 - 1
Optimizer/Controls/MoonTip.cs

@@ -40,7 +40,7 @@ namespace Optimizer
 
             g.FillRectangle(b, e.Bounds);
 
-            g.DrawRectangle(new Pen(Color.FromArgb(40, 40, 40), 1), new Rectangle(e.Bounds.X, e.Bounds.Y,
+            g.DrawRectangle(new Pen(Options.ForegroundColor, 1), new Rectangle(e.Bounds.X, e.Bounds.Y,
                 e.Bounds.Width - 1, e.Bounds.Height - 1));
 
 

+ 170 - 146
Optimizer/Forms/MainForm.Designer.cs

@@ -50,7 +50,7 @@ namespace Optimizer
             this.pictureBox1 = new System.Windows.Forms.PictureBox();
             this.label2 = new System.Windows.Forms.Label();
             this.bpanel = new System.Windows.Forms.Panel();
-            this.tabCollection = new Optimizer.MoonTabs();
+            this.tabCollection = new System.Windows.Forms.TabControl();
             this.universalTab = new System.Windows.Forms.TabPage();
             this.windows10Tab = new System.Windows.Forms.TabPage();
             this.panelWin11Tweaks = new System.Windows.Forms.Panel();
@@ -120,14 +120,13 @@ namespace Optimizer
             this.pictureBox9 = new System.Windows.Forms.PictureBox();
             this.pictureBox8 = new System.Windows.Forms.PictureBox();
             this.pingerTab = new System.Windows.Forms.TabPage();
-            this.btnOpenNetwork = new System.Windows.Forms.Button();
-            this.txtIPv6A = new System.Windows.Forms.LinkLabel();
-            this.txtIPv6 = new System.Windows.Forms.LinkLabel();
+            this.linkDNSv6A = new System.Windows.Forms.LinkLabel();
+            this.linkDNSv4A = new System.Windows.Forms.LinkLabel();
+            this.linkDNSv6 = new System.Windows.Forms.LinkLabel();
+            this.linkDNSv4 = new System.Windows.Forms.LinkLabel();
             this.label3 = new System.Windows.Forms.Label();
-            this.txtIPv4A = new System.Windows.Forms.LinkLabel();
             this.label1 = new System.Windows.Forms.Label();
-            this.txtIPv4 = new System.Windows.Forms.LinkLabel();
-            this.lblDNS = new System.Windows.Forms.Label();
+            this.btnOpenNetwork = new System.Windows.Forms.Button();
             this.flushCacheB = new System.Windows.Forms.Button();
             this.btnExport = new System.Windows.Forms.Button();
             this.copyB = new System.Windows.Forms.Button();
@@ -170,7 +169,7 @@ namespace Optimizer
             this.btnCopyHW = new System.Windows.Forms.Button();
             this.btnSaveHW = new System.Windows.Forms.Button();
             this.integratorTab = new System.Windows.Forms.TabPage();
-            this.synapse = new Optimizer.MoonTabs();
+            this.synapse = new System.Windows.Forms.TabControl();
             this.integratorInfoTab = new System.Windows.Forms.TabPage();
             this.integrator7 = new System.Windows.Forms.Label();
             this.integrator6 = new System.Windows.Forms.Label();
@@ -353,6 +352,8 @@ namespace Optimizer
             this.checkTemp = new Optimizer.MoonCheck();
             this.checkBin = new Optimizer.MoonCheck();
             this.checkMiniDumps = new Optimizer.MoonCheck();
+            this.boxAdapter = new Optimizer.MoonSelect();
+            this.boxDNS = new Optimizer.MoonSelect();
             this.listPingResults = new Optimizer.MoonList();
             this.chkReadOnly = new Optimizer.MoonCheck();
             this.listHostEntries = new Optimizer.MoonList();
@@ -1633,14 +1634,15 @@ namespace Optimizer
             // pingerTab
             // 
             this.pingerTab.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
-            this.pingerTab.Controls.Add(this.btnOpenNetwork);
-            this.pingerTab.Controls.Add(this.txtIPv6A);
-            this.pingerTab.Controls.Add(this.txtIPv6);
+            this.pingerTab.Controls.Add(this.linkDNSv6A);
+            this.pingerTab.Controls.Add(this.linkDNSv4A);
+            this.pingerTab.Controls.Add(this.linkDNSv6);
+            this.pingerTab.Controls.Add(this.linkDNSv4);
             this.pingerTab.Controls.Add(this.label3);
-            this.pingerTab.Controls.Add(this.txtIPv4A);
             this.pingerTab.Controls.Add(this.label1);
-            this.pingerTab.Controls.Add(this.txtIPv4);
-            this.pingerTab.Controls.Add(this.lblDNS);
+            this.pingerTab.Controls.Add(this.boxAdapter);
+            this.pingerTab.Controls.Add(this.boxDNS);
+            this.pingerTab.Controls.Add(this.btnOpenNetwork);
             this.pingerTab.Controls.Add(this.flushCacheB);
             this.pingerTab.Controls.Add(this.btnExport);
             this.pingerTab.Controls.Add(this.copyB);
@@ -1659,125 +1661,108 @@ namespace Optimizer
             this.pingerTab.TabIndex = 13;
             this.pingerTab.Text = "Pinger";
             // 
-            // btnOpenNetwork
-            // 
-            this.btnOpenNetwork.BackColor = System.Drawing.Color.DodgerBlue;
-            this.btnOpenNetwork.FlatAppearance.BorderSize = 0;
-            this.btnOpenNetwork.FlatAppearance.MouseDownBackColor = System.Drawing.Color.RoyalBlue;
-            this.btnOpenNetwork.FlatAppearance.MouseOverBackColor = System.Drawing.Color.RoyalBlue;
-            this.btnOpenNetwork.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
-            this.btnOpenNetwork.ForeColor = System.Drawing.Color.White;
-            this.btnOpenNetwork.Location = new System.Drawing.Point(579, 381);
-            this.btnOpenNetwork.Margin = new System.Windows.Forms.Padding(2);
-            this.btnOpenNetwork.Name = "btnOpenNetwork";
-            this.btnOpenNetwork.Size = new System.Drawing.Size(200, 29);
-            this.btnOpenNetwork.TabIndex = 92;
-            this.btnOpenNetwork.Text = "Open Network Connections";
-            this.btnOpenNetwork.UseVisualStyleBackColor = false;
-            this.btnOpenNetwork.Click += new System.EventHandler(this.btnOpenNetwork_Click);
-            // 
-            // txtIPv6A
-            // 
-            this.txtIPv6A.AutoSize = true;
-            this.txtIPv6A.Font = new System.Drawing.Font("Segoe UI Semibold", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
-            this.txtIPv6A.ForeColor = System.Drawing.Color.DodgerBlue;
-            this.txtIPv6A.LinkColor = System.Drawing.Color.DodgerBlue;
-            this.txtIPv6A.Location = new System.Drawing.Point(618, 335);
-            this.txtIPv6A.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
-            this.txtIPv6A.Name = "txtIPv6A";
-            this.txtIPv6A.Size = new System.Drawing.Size(164, 21);
-            this.txtIPv6A.TabIndex = 91;
-            this.txtIPv6A.TabStop = true;
-            this.txtIPv6A.Tag = "themeable";
-            this.txtIPv6A.Text = "2606:4700:4700::1001";
-            this.txtIPv6A.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.txtIPv6A_LinkClicked);
-            // 
-            // txtIPv6
-            // 
-            this.txtIPv6.AutoSize = true;
-            this.txtIPv6.Font = new System.Drawing.Font("Segoe UI Semibold", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
-            this.txtIPv6.ForeColor = System.Drawing.Color.DodgerBlue;
-            this.txtIPv6.LinkColor = System.Drawing.Color.DodgerBlue;
-            this.txtIPv6.Location = new System.Drawing.Point(618, 311);
-            this.txtIPv6.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
-            this.txtIPv6.Name = "txtIPv6";
-            this.txtIPv6.Size = new System.Drawing.Size(158, 21);
-            this.txtIPv6.TabIndex = 90;
-            this.txtIPv6.TabStop = true;
-            this.txtIPv6.Tag = "themeable";
-            this.txtIPv6.Text = "2606:4700:4700::1111";
-            this.txtIPv6.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.txtIPv6_LinkClicked);
+            // linkDNSv6A
+            // 
+            this.linkDNSv6A.AutoSize = true;
+            this.linkDNSv6A.Font = new System.Drawing.Font("Segoe UI Semibold", 11F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.linkDNSv6A.ForeColor = System.Drawing.Color.DodgerBlue;
+            this.linkDNSv6A.LinkColor = System.Drawing.Color.DodgerBlue;
+            this.linkDNSv6A.Location = new System.Drawing.Point(541, 251);
+            this.linkDNSv6A.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.linkDNSv6A.Name = "linkDNSv6A";
+            this.linkDNSv6A.Size = new System.Drawing.Size(15, 20);
+            this.linkDNSv6A.TabIndex = 103;
+            this.linkDNSv6A.TabStop = true;
+            this.linkDNSv6A.Tag = "themeable";
+            this.linkDNSv6A.Text = "-";
+            // 
+            // linkDNSv4A
+            // 
+            this.linkDNSv4A.AutoSize = true;
+            this.linkDNSv4A.Font = new System.Drawing.Font("Segoe UI Semibold", 11F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.linkDNSv4A.ForeColor = System.Drawing.Color.DodgerBlue;
+            this.linkDNSv4A.LinkColor = System.Drawing.Color.DodgerBlue;
+            this.linkDNSv4A.Location = new System.Drawing.Point(540, 194);
+            this.linkDNSv4A.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.linkDNSv4A.Name = "linkDNSv4A";
+            this.linkDNSv4A.Size = new System.Drawing.Size(15, 20);
+            this.linkDNSv4A.TabIndex = 102;
+            this.linkDNSv4A.TabStop = true;
+            this.linkDNSv4A.Tag = "themeable";
+            this.linkDNSv4A.Text = "-";
+            // 
+            // linkDNSv6
+            // 
+            this.linkDNSv6.AutoSize = true;
+            this.linkDNSv6.Font = new System.Drawing.Font("Segoe UI Semibold", 11F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.linkDNSv6.ForeColor = System.Drawing.Color.DodgerBlue;
+            this.linkDNSv6.LinkColor = System.Drawing.Color.DodgerBlue;
+            this.linkDNSv6.Location = new System.Drawing.Point(541, 228);
+            this.linkDNSv6.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.linkDNSv6.Name = "linkDNSv6";
+            this.linkDNSv6.Size = new System.Drawing.Size(15, 20);
+            this.linkDNSv6.TabIndex = 101;
+            this.linkDNSv6.TabStop = true;
+            this.linkDNSv6.Tag = "themeable";
+            this.linkDNSv6.Text = "-";
+            // 
+            // linkDNSv4
+            // 
+            this.linkDNSv4.AutoSize = true;
+            this.linkDNSv4.Font = new System.Drawing.Font("Segoe UI Semibold", 11F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.linkDNSv4.ForeColor = System.Drawing.Color.DodgerBlue;
+            this.linkDNSv4.LinkColor = System.Drawing.Color.DodgerBlue;
+            this.linkDNSv4.Location = new System.Drawing.Point(541, 171);
+            this.linkDNSv4.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.linkDNSv4.Name = "linkDNSv4";
+            this.linkDNSv4.Size = new System.Drawing.Size(15, 20);
+            this.linkDNSv4.TabIndex = 100;
+            this.linkDNSv4.TabStop = true;
+            this.linkDNSv4.Tag = "themeable";
+            this.linkDNSv4.Text = "-";
             // 
             // label3
             // 
             this.label3.AutoSize = true;
-            this.label3.Font = new System.Drawing.Font("Segoe UI Semibold", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.label3.Font = new System.Drawing.Font("Segoe UI Semibold", 11F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
             this.label3.ForeColor = System.Drawing.Color.Silver;
-            this.label3.Location = new System.Drawing.Point(575, 313);
+            this.label3.Location = new System.Drawing.Point(459, 229);
             this.label3.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(39, 19);
-            this.label3.TabIndex = 89;
+            this.label3.Size = new System.Drawing.Size(77, 20);
+            this.label3.TabIndex = 99;
             this.label3.Tag = "";
-            this.label3.Text = "IPv6:";
-            // 
-            // txtIPv4A
-            // 
-            this.txtIPv4A.AutoSize = true;
-            this.txtIPv4A.Font = new System.Drawing.Font("Segoe UI Semibold", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
-            this.txtIPv4A.ForeColor = System.Drawing.Color.DodgerBlue;
-            this.txtIPv4A.LinkColor = System.Drawing.Color.DodgerBlue;
-            this.txtIPv4A.Location = new System.Drawing.Point(618, 271);
-            this.txtIPv4A.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
-            this.txtIPv4A.Name = "txtIPv4A";
-            this.txtIPv4A.Size = new System.Drawing.Size(52, 21);
-            this.txtIPv4A.TabIndex = 88;
-            this.txtIPv4A.TabStop = true;
-            this.txtIPv4A.Tag = "themeable";
-            this.txtIPv4A.Text = "1.0.0.1";
-            this.txtIPv4A.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.txtIPv4A_LinkClicked);
+            this.label3.Text = "DNS IPv6:";
             // 
             // label1
             // 
             this.label1.AutoSize = true;
-            this.label1.Font = new System.Drawing.Font("Segoe UI Semibold", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.label1.Font = new System.Drawing.Font("Segoe UI Semibold", 11F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
             this.label1.ForeColor = System.Drawing.Color.Silver;
-            this.label1.Location = new System.Drawing.Point(575, 250);
+            this.label1.Location = new System.Drawing.Point(459, 172);
             this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(39, 19);
-            this.label1.TabIndex = 87;
+            this.label1.Size = new System.Drawing.Size(78, 20);
+            this.label1.TabIndex = 98;
             this.label1.Tag = "";
-            this.label1.Text = "IPv4:";
-            // 
-            // txtIPv4
-            // 
-            this.txtIPv4.AutoSize = true;
-            this.txtIPv4.Font = new System.Drawing.Font("Segoe UI Semibold", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
-            this.txtIPv4.ForeColor = System.Drawing.Color.DodgerBlue;
-            this.txtIPv4.LinkColor = System.Drawing.Color.DodgerBlue;
-            this.txtIPv4.Location = new System.Drawing.Point(618, 247);
-            this.txtIPv4.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
-            this.txtIPv4.Name = "txtIPv4";
-            this.txtIPv4.Size = new System.Drawing.Size(46, 21);
-            this.txtIPv4.TabIndex = 86;
-            this.txtIPv4.TabStop = true;
-            this.txtIPv4.Tag = "themeable";
-            this.txtIPv4.Text = "1.1.1.1";
-            this.txtIPv4.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.txtIPv4_LinkClicked);
-            // 
-            // lblDNS
-            // 
-            this.lblDNS.AutoSize = true;
-            this.lblDNS.Font = new System.Drawing.Font("Segoe UI Semibold", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
-            this.lblDNS.ForeColor = System.Drawing.Color.Silver;
-            this.lblDNS.Location = new System.Drawing.Point(575, 196);
-            this.lblDNS.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
-            this.lblDNS.Name = "lblDNS";
-            this.lblDNS.Size = new System.Drawing.Size(204, 38);
-            this.lblDNS.TabIndex = 85;
-            this.lblDNS.Tag = "";
-            this.lblDNS.Text = "Recommended Cloudflare DNS\r\n(click to copy)";
+            this.label1.Text = "DNS IPv4:";
+            // 
+            // btnOpenNetwork
+            // 
+            this.btnOpenNetwork.BackColor = System.Drawing.Color.DodgerBlue;
+            this.btnOpenNetwork.FlatAppearance.BorderSize = 0;
+            this.btnOpenNetwork.FlatAppearance.MouseDownBackColor = System.Drawing.Color.RoyalBlue;
+            this.btnOpenNetwork.FlatAppearance.MouseOverBackColor = System.Drawing.Color.RoyalBlue;
+            this.btnOpenNetwork.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.btnOpenNetwork.ForeColor = System.Drawing.Color.White;
+            this.btnOpenNetwork.Location = new System.Drawing.Point(463, 332);
+            this.btnOpenNetwork.Margin = new System.Windows.Forms.Padding(2);
+            this.btnOpenNetwork.Name = "btnOpenNetwork";
+            this.btnOpenNetwork.Size = new System.Drawing.Size(212, 29);
+            this.btnOpenNetwork.TabIndex = 92;
+            this.btnOpenNetwork.Text = "Open Network Connections";
+            this.btnOpenNetwork.UseVisualStyleBackColor = false;
+            this.btnOpenNetwork.Click += new System.EventHandler(this.btnOpenNetwork_Click);
             // 
             // flushCacheB
             // 
@@ -1787,10 +1772,10 @@ namespace Optimizer
             this.flushCacheB.FlatAppearance.MouseOverBackColor = System.Drawing.Color.RoyalBlue;
             this.flushCacheB.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
             this.flushCacheB.ForeColor = System.Drawing.Color.White;
-            this.flushCacheB.Location = new System.Drawing.Point(579, 414);
+            this.flushCacheB.Location = new System.Drawing.Point(463, 299);
             this.flushCacheB.Margin = new System.Windows.Forms.Padding(2);
             this.flushCacheB.Name = "flushCacheB";
-            this.flushCacheB.Size = new System.Drawing.Size(200, 29);
+            this.flushCacheB.Size = new System.Drawing.Size(212, 29);
             this.flushCacheB.TabIndex = 84;
             this.flushCacheB.Text = "Flush DNS cache";
             this.flushCacheB.UseVisualStyleBackColor = false;
@@ -1804,7 +1789,7 @@ namespace Optimizer
             this.btnExport.FlatAppearance.MouseOverBackColor = System.Drawing.Color.RoyalBlue;
             this.btnExport.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
             this.btnExport.ForeColor = System.Drawing.Color.White;
-            this.btnExport.Location = new System.Drawing.Point(26, 512);
+            this.btnExport.Location = new System.Drawing.Point(28, 494);
             this.btnExport.Margin = new System.Windows.Forms.Padding(2);
             this.btnExport.Name = "btnExport";
             this.btnExport.Size = new System.Drawing.Size(107, 29);
@@ -1821,10 +1806,10 @@ namespace Optimizer
             this.copyB.FlatAppearance.MouseOverBackColor = System.Drawing.Color.RoyalBlue;
             this.copyB.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
             this.copyB.ForeColor = System.Drawing.Color.White;
-            this.copyB.Location = new System.Drawing.Point(265, 116);
+            this.copyB.Location = new System.Drawing.Point(26, 151);
             this.copyB.Margin = new System.Windows.Forms.Padding(2);
             this.copyB.Name = "copyB";
-            this.copyB.Size = new System.Drawing.Size(146, 31);
+            this.copyB.Size = new System.Drawing.Size(160, 31);
             this.copyB.TabIndex = 82;
             this.copyB.Text = "Copy IP";
             this.copyB.UseVisualStyleBackColor = false;
@@ -1838,10 +1823,10 @@ namespace Optimizer
             this.copyIPB.FlatAppearance.MouseOverBackColor = System.Drawing.Color.RoyalBlue;
             this.copyIPB.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
             this.copyIPB.ForeColor = System.Drawing.Color.White;
-            this.copyIPB.Location = new System.Drawing.Point(415, 116);
+            this.copyIPB.Location = new System.Drawing.Point(190, 151);
             this.copyIPB.Margin = new System.Windows.Forms.Padding(2);
             this.copyIPB.Name = "copyIPB";
-            this.copyIPB.Size = new System.Drawing.Size(146, 31);
+            this.copyIPB.Size = new System.Drawing.Size(160, 31);
             this.copyIPB.TabIndex = 81;
             this.copyIPB.Text = "Copy";
             this.copyIPB.UseVisualStyleBackColor = false;
@@ -1851,20 +1836,20 @@ namespace Optimizer
             // 
             this.panel7.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
             this.panel7.Controls.Add(this.listPingResults);
-            this.panel7.Location = new System.Drawing.Point(26, 200);
+            this.panel7.Location = new System.Drawing.Point(28, 219);
             this.panel7.Name = "panel7";
-            this.panel7.Size = new System.Drawing.Size(544, 307);
+            this.panel7.Size = new System.Drawing.Size(322, 270);
             this.panel7.TabIndex = 80;
             // 
             // lblResults
             // 
             this.lblResults.AutoSize = true;
-            this.lblResults.Font = new System.Drawing.Font("Segoe UI Semibold", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.lblResults.Font = new System.Drawing.Font("Segoe UI Semibold", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
             this.lblResults.ForeColor = System.Drawing.Color.Silver;
-            this.lblResults.Location = new System.Drawing.Point(21, 176);
+            this.lblResults.Location = new System.Drawing.Point(23, 195);
             this.lblResults.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.lblResults.Name = "lblResults";
-            this.lblResults.Size = new System.Drawing.Size(62, 21);
+            this.lblResults.Size = new System.Drawing.Size(54, 19);
             this.lblResults.TabIndex = 60;
             this.lblResults.Tag = "";
             this.lblResults.Text = "Results";
@@ -1877,7 +1862,7 @@ namespace Optimizer
             this.btnShodan.FlatAppearance.MouseOverBackColor = System.Drawing.Color.RoyalBlue;
             this.btnShodan.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
             this.btnShodan.ForeColor = System.Drawing.Color.White;
-            this.btnShodan.Location = new System.Drawing.Point(101, 116);
+            this.btnShodan.Location = new System.Drawing.Point(26, 116);
             this.btnShodan.Margin = new System.Windows.Forms.Padding(2);
             this.btnShodan.Name = "btnShodan";
             this.btnShodan.Size = new System.Drawing.Size(160, 31);
@@ -1894,10 +1879,10 @@ namespace Optimizer
             this.btnPing.FlatAppearance.MouseOverBackColor = System.Drawing.Color.RoyalBlue;
             this.btnPing.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
             this.btnPing.ForeColor = System.Drawing.Color.White;
-            this.btnPing.Location = new System.Drawing.Point(26, 116);
+            this.btnPing.Location = new System.Drawing.Point(190, 116);
             this.btnPing.Margin = new System.Windows.Forms.Padding(2);
             this.btnPing.Name = "btnPing";
-            this.btnPing.Size = new System.Drawing.Size(71, 31);
+            this.btnPing.Size = new System.Drawing.Size(160, 31);
             this.btnPing.TabIndex = 58;
             this.btnPing.Text = "Ping";
             this.btnPing.UseVisualStyleBackColor = false;
@@ -1912,7 +1897,7 @@ namespace Optimizer
             this.txtPingInput.Location = new System.Drawing.Point(26, 83);
             this.txtPingInput.Margin = new System.Windows.Forms.Padding(2);
             this.txtPingInput.Name = "txtPingInput";
-            this.txtPingInput.Size = new System.Drawing.Size(535, 29);
+            this.txtPingInput.Size = new System.Drawing.Size(324, 29);
             this.txtPingInput.TabIndex = 56;
             this.txtPingInput.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
             this.txtPingInput.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtPingInput_KeyDown);
@@ -1920,12 +1905,12 @@ namespace Optimizer
             // lblPinger
             // 
             this.lblPinger.AutoSize = true;
-            this.lblPinger.Font = new System.Drawing.Font("Segoe UI Semibold", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.lblPinger.Font = new System.Drawing.Font("Segoe UI Semibold", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
             this.lblPinger.ForeColor = System.Drawing.Color.Silver;
             this.lblPinger.Location = new System.Drawing.Point(23, 60);
             this.lblPinger.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.lblPinger.Name = "lblPinger";
-            this.lblPinger.Size = new System.Drawing.Size(139, 21);
+            this.lblPinger.Size = new System.Drawing.Size(122, 19);
             this.lblPinger.TabIndex = 57;
             this.lblPinger.Tag = "";
             this.lblPinger.Text = "IP / Domain name";
@@ -4927,13 +4912,51 @@ namespace Optimizer
             this.checkMiniDumps.Text = "BSOD Minidumps";
             this.checkMiniDumps.UseVisualStyleBackColor = true;
             // 
+            // boxAdapter
+            // 
+            this.boxAdapter.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(40)))), ((int)(((byte)(40)))));
+            this.boxAdapter.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
+            this.boxAdapter.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.boxAdapter.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.boxAdapter.Font = new System.Drawing.Font("Segoe UI Semibold", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.boxAdapter.ForeColor = System.Drawing.Color.White;
+            this.boxAdapter.FormattingEnabled = true;
+            this.boxAdapter.Location = new System.Drawing.Point(460, 83);
+            this.boxAdapter.Name = "boxAdapter";
+            this.boxAdapter.Size = new System.Drawing.Size(414, 29);
+            this.boxAdapter.TabIndex = 97;
+            // 
+            // boxDNS
+            // 
+            this.boxDNS.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(40)))), ((int)(((byte)(40)))), ((int)(((byte)(40)))));
+            this.boxDNS.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
+            this.boxDNS.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.boxDNS.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.boxDNS.Font = new System.Drawing.Font("Segoe UI Semibold", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.boxDNS.ForeColor = System.Drawing.Color.White;
+            this.boxDNS.FormattingEnabled = true;
+            this.boxDNS.Items.AddRange(new object[] {
+            "Automatic",
+            "Cloudflare DNS",
+            "Open DNS",
+            "Quad9 DNS",
+            "Google DNS",
+            "Alternate DNS",
+            "Adguard DNS",
+            "CleanBrowsing",
+            "CleanBrowsing (adult filter)"});
+            this.boxDNS.Location = new System.Drawing.Point(460, 118);
+            this.boxDNS.Name = "boxDNS";
+            this.boxDNS.Size = new System.Drawing.Size(414, 29);
+            this.boxDNS.TabIndex = 96;
+            // 
             // listPingResults
             // 
             this.listPingResults.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(20)))), ((int)(((byte)(20)))), ((int)(((byte)(20)))));
             this.listPingResults.BorderStyle = System.Windows.Forms.BorderStyle.None;
             this.listPingResults.Dock = System.Windows.Forms.DockStyle.Fill;
             this.listPingResults.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawVariable;
-            this.listPingResults.Font = new System.Drawing.Font("Segoe UI Semibold", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+            this.listPingResults.Font = new System.Drawing.Font("Segoe UI Semibold", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
             this.listPingResults.ForeColor = System.Drawing.Color.White;
             this.listPingResults.FormattingEnabled = true;
             this.listPingResults.HorizontalScrollbar = true;
@@ -4941,7 +4964,7 @@ namespace Optimizer
             this.listPingResults.Location = new System.Drawing.Point(0, 0);
             this.listPingResults.Margin = new System.Windows.Forms.Padding(2);
             this.listPingResults.Name = "listPingResults";
-            this.listPingResults.Size = new System.Drawing.Size(542, 305);
+            this.listPingResults.Size = new System.Drawing.Size(320, 268);
             this.listPingResults.TabIndex = 79;
             // 
             // chkReadOnly
@@ -5556,7 +5579,7 @@ namespace Optimizer
         private System.Windows.Forms.PictureBox pictureBox1;
         private System.Windows.Forms.Label label2;
         private System.Windows.Forms.Panel bpanel;
-        private Optimizer.MoonTabs tabCollection;
+        private System.Windows.Forms.TabControl tabCollection;
         private System.Windows.Forms.TabPage universalTab;
         private System.Windows.Forms.TabPage windows10Tab;
         private System.Windows.Forms.TabPage windows8Tab;
@@ -5602,7 +5625,7 @@ namespace Optimizer
         private System.Windows.Forms.Button addHostB;
         private System.Windows.Forms.TextBox txtIP;
         private System.Windows.Forms.TabPage integratorTab;
-        private Optimizer.MoonTabs synapse;
+        private System.Windows.Forms.TabControl synapse;
         private System.Windows.Forms.TabPage integratorInfoTab;
         private System.Windows.Forms.TabPage tabPage8;
         private System.Windows.Forms.TabPage tabPage9;
@@ -5765,13 +5788,6 @@ namespace Optimizer
         private Label lblCoding;
         private Label lblSystemTools;
         private Label lblInternet;
-        private Label lblDNS;
-        private LinkLabel txtIPv4;
-        private LinkLabel txtIPv6A;
-        private LinkLabel txtIPv6;
-        private Label label3;
-        private LinkLabel txtIPv4A;
-        private Label label1;
         private Button btnOpenNetwork;
         private Panel panelWin11Tweaks;
         private ToolStripMenuItem trayRegistry;
@@ -5894,6 +5910,14 @@ namespace Optimizer
         private PictureBox pictureBox3;
         private LinkLabel linkLabel3;
         private ToggleCard compactModeSw;
+        private MoonSelect boxDNS;
+        private MoonSelect boxAdapter;
+        private Label label3;
+        private Label label1;
+        private LinkLabel linkDNSv6;
+        private LinkLabel linkDNSv4;
+        private LinkLabel linkDNSv6A;
+        private LinkLabel linkDNSv4A;
     }
 }
 

+ 206 - 27
Optimizer/Forms/MainForm.cs

@@ -80,6 +80,8 @@ namespace Optimizer
         bool _skipOneDrive = false;
         bool _skipSystemRestore = false;
 
+        string[] _currentDNS;
+
         ColorOverrider _colorOverrider;
 
         List<TreeNode> _hwDetailed;
@@ -603,7 +605,7 @@ namespace Optimizer
         }
 
         //INIT
-        public MainForm(SplashForm _splashForm, bool disableIndicium = false, bool disableHostsEditor = false, bool disableCommonApps = false, bool disableUWPApps = false, bool disableStartups = false, bool disableCleaner = false, bool disableIntegrator = false)
+        public MainForm(SplashForm _splashForm, bool disableIndicium = false, bool disableHostsEditor = false, bool disableCommonApps = false, bool disableUWPApps = false, bool disableStartups = false, bool disableCleaner = false, bool disableIntegrator = false, bool disablePinger = false)
         {
             InitializeComponent();
 
@@ -809,6 +811,21 @@ namespace Optimizer
                 launcherMenu.Items.RemoveByKey("trayHW");
             }
 
+            // PINGER
+            if (!disablePinger)
+            {
+                LoadPingerDNSConfig();
+                DisplayCurrentDNS();
+
+                boxDNS.SelectedIndexChanged += boxDNS_SelectedIndexChanged;
+                boxAdapter.SelectedIndexChanged += boxAdapter_SelectedIndexChanged;
+            }
+            else
+            {
+                tabCollection.TabPages.Remove(pingerTab);
+                launcherMenu.Items.RemoveByKey("trayPinger");
+            }
+
             LoadSettings();
 
             LoadTranslationAndSetSize();
@@ -839,7 +856,7 @@ namespace Optimizer
                 txtDownloadFolder.Text = Options.CurrentOptions.AppsFolder;
             }
 
-            if (!Program.EXPERIMENTAL_BUILD && Utilities.IsInternetAvailable()) CheckForUpdate(true);
+            if (!Program.EXPERIMENTAL_BUILD && PingerHelper.IsInternetAvailable()) CheckForUpdate(true);
 
             if (Program.EXPERIMENTAL_BUILD)
             {
@@ -854,6 +871,73 @@ namespace Optimizer
             EnableToggleEvents();
         }
 
+        private void LoadPingerDNSConfig()
+        {
+            boxAdapter.Items.AddRange(PingerHelper.GetActiveNetworkAdapters().Select(z => z.Description).ToArray());
+            if (boxAdapter.Items.Count > 0) boxAdapter.SelectedIndex = 0;
+
+            linkDNSv4.LinkClicked += linkDNSIP_LinkClicked;
+            linkDNSv4A.LinkClicked += linkDNSIP_LinkClicked;
+            linkDNSv6.LinkClicked += linkDNSIP_LinkClicked;
+            linkDNSv6A.LinkClicked += linkDNSIP_LinkClicked;
+
+            LoadNetworkAdapterConfig();
+        }
+
+        private void LoadNetworkAdapterConfig()
+        {
+            if (boxAdapter.Items.Count <= 0) return;
+
+            PingerHelper.GetActiveNetworkAdapters();
+            _currentDNS = PingerHelper.GetDNSFromNetworkAdapter(PingerHelper.NetworkAdapters[boxAdapter.SelectedIndex]).ToArray();
+
+            if (PingerHelper.CloudflareDNSv4.Any(x => _currentDNS.Select(y => y.ToString()).Contains(x)))
+            {
+                boxDNS.Text = "Cloudflare DNS";
+                return;
+            }
+            else if (PingerHelper.OpenDNSv4.Any(x => _currentDNS.Select(y => y.ToString()).Contains(x)))
+            {
+                boxDNS.Text = "Open DNS";
+                return;
+            }
+            else if (PingerHelper.Quad9DNSv4.Any(x => _currentDNS.Select(y => y.ToString()).Contains(x)))
+            {
+                boxDNS.Text = "Quad9 DNS";
+                return;
+            }
+            else if (PingerHelper.GoogleDNSv4.Any(x => _currentDNS.Select(y => y.ToString()).Contains(x)))
+            {
+                boxDNS.Text = "Google DNS";
+                return;
+            }
+            else if (PingerHelper.AlternateDNSv4.Any(x => _currentDNS.Select(y => y.ToString()).Contains(x)))
+            {
+                boxDNS.Text = "Alternate DNS";
+                return;
+            }
+            else if (PingerHelper.AdguardDNSv4.Any(x => _currentDNS.Select(y => y.ToString()).Contains(x)))
+            {
+                boxDNS.Text = "Adguard DNS";
+                return;
+            }
+            else if (PingerHelper.CleanBrowsingDNSv4.Any(x => _currentDNS.Select(y => y.ToString()).Contains(x)))
+            {
+                boxDNS.Text = "CleanBrowsing";
+                return;
+            }
+            else if (PingerHelper.CleanBrowsingAdultDNSv4.Any(x => _currentDNS.Select(y => y.ToString()).Contains(x)))
+            {
+                boxDNS.Text = "CleanBrowsing (adult filter)";
+                return;
+            }
+            else
+            {
+                boxDNS.Text = "Automatic";
+                return;
+            }
+        }
+
         private void LoadTranslationAndSetSize()
         {
             if (Options.CurrentOptions.LanguageCode == LanguageCode.EN)
@@ -3539,7 +3623,7 @@ namespace Optimizer
 
             listPingResults.Items.Clear();
 
-            if (Utilities.PingHost(txtPingInput.Text) == null)
+            if (PingerHelper.PingHost(txtPingInput.Text) == null)
             {
                 listPingResults.Items.Add(string.Format("{0} [{1}]", Options.TranslationList["hostNotFound"], txtPingInput.Text));
                 return;
@@ -3550,15 +3634,15 @@ namespace Optimizer
                 btnShodan.Enabled = false;
                 btnPing.Enabled = false;
 
-                listPingResults.Items.Add(string.Format("{0} [{1}]", Options.TranslationList["pinging"], txtPingInput.Text));
+                listPingResults.Items.Add(string.Format("{0}", Options.TranslationList["pinging"]));
                 listPingResults.Items.Add("");
 
                 for (int i = 0; i < 9; i++)
                 {
                     // wait before each pinging
-                    Thread.Sleep(888);
+                    Thread.Sleep(1000);
 
-                    tmpReply = Utilities.PingHost(txtPingInput.Text);
+                    tmpReply = PingerHelper.PingHost(txtPingInput.Text);
 
                     if (tmpReply.Address == null)
                     {
@@ -3727,7 +3811,7 @@ namespace Optimizer
         {
             if (MessageBox.Show(_flushDNSMessage, "Optimizer", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
             {
-                Utilities.FlushDNSCache();
+                PingerHelper.FlushDNSCache();
             }
         }
 
@@ -3803,26 +3887,6 @@ namespace Optimizer
             }
         }
 
-        private void txtIPv4_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
-        {
-            Clipboard.SetText(txtIPv4.Text);
-        }
-
-        private void txtIPv4A_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
-        {
-            Clipboard.SetText(txtIPv4A.Text);
-        }
-
-        private void txtIPv6_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
-        {
-            Clipboard.SetText(txtIPv6.Text);
-        }
-
-        private void txtIPv6A_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
-        {
-            Clipboard.SetText(txtIPv6A.Text);
-        }
-
         private void btnOpenNetwork_Click(object sender, EventArgs e)
         {
             Process.Start("NCPA.cpl");
@@ -4189,5 +4253,120 @@ namespace Optimizer
         {
             Process.Start(_paypalSupportLink);
         }
+
+        private void linkDNSIP_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
+        {
+            try
+            {
+                Clipboard.SetText(((LinkLabel)sender).Text);
+            }
+            catch { }
+        }
+
+        private void boxDNS_SelectedIndexChanged(object sender, EventArgs e)
+        {
+            if (boxDNS.Text == "Automatic")
+            {
+                PingerHelper.ResetDefaultDNS(PingerHelper.NetworkAdapters[boxAdapter.SelectedIndex].Name);
+                PingerHelper.GetActiveNetworkAdapters();
+                DisplayCurrentDNS();
+                return;
+            }
+            else if (boxDNS.Text == "Cloudflare DNS")
+            {
+                PingerHelper.SetDNS(PingerHelper.NetworkAdapters[boxAdapter.SelectedIndex].Name, PingerHelper.CloudflareDNSv4, PingerHelper.CloudflareDNSv6);
+                PingerHelper.GetActiveNetworkAdapters();
+                DisplayCurrentDNS();
+                return;
+            }
+            else if (boxDNS.Text == "Open DNS")
+            {
+                PingerHelper.SetDNS(PingerHelper.NetworkAdapters[boxAdapter.SelectedIndex].Name, PingerHelper.OpenDNSv4, PingerHelper.OpenDNSv6);
+                PingerHelper.GetActiveNetworkAdapters();
+                DisplayCurrentDNS();
+                return;
+            }
+            else if (boxDNS.Text == "Quad9 DNS")
+            {
+                PingerHelper.SetDNS(PingerHelper.NetworkAdapters[boxAdapter.SelectedIndex].Name, PingerHelper.Quad9DNSv4, PingerHelper.Quad9DNSv6);
+                PingerHelper.GetActiveNetworkAdapters();
+                DisplayCurrentDNS();
+                return;
+            }
+            else if (boxDNS.Text == "Google DNS")
+            {
+                PingerHelper.SetDNS(PingerHelper.NetworkAdapters[boxAdapter.SelectedIndex].Name, PingerHelper.GoogleDNSv4, PingerHelper.GoogleDNSv6);
+                PingerHelper.GetActiveNetworkAdapters();
+                DisplayCurrentDNS();
+                return;
+            }
+            else if (boxDNS.Text == "Alternate DNS")
+            {
+                PingerHelper.SetDNS(PingerHelper.NetworkAdapters[boxAdapter.SelectedIndex].Name, PingerHelper.AlternateDNSv4, PingerHelper.AlternateDNSv6);
+                PingerHelper.GetActiveNetworkAdapters();
+                DisplayCurrentDNS();
+                return;
+            }
+            else if (boxDNS.Text == "Adguard DNS")
+            {
+                PingerHelper.SetDNS(PingerHelper.NetworkAdapters[boxAdapter.SelectedIndex].Name, PingerHelper.AdguardDNSv4, PingerHelper.AdguardDNSv6);
+                PingerHelper.GetActiveNetworkAdapters();
+                DisplayCurrentDNS();
+                return;
+            }
+            else if (boxDNS.Text == "CleanBrowsing")
+            {
+                PingerHelper.SetDNS(PingerHelper.NetworkAdapters[boxAdapter.SelectedIndex].Name, PingerHelper.CleanBrowsingDNSv4, PingerHelper.CleanBrowsingDNSv6);
+                PingerHelper.GetActiveNetworkAdapters();
+                DisplayCurrentDNS();
+                return;
+            }
+            else if (boxDNS.Text == "CleanBrowsing (adult filter)")
+            {
+                PingerHelper.SetDNS(PingerHelper.NetworkAdapters[boxAdapter.SelectedIndex].Name, PingerHelper.CleanBrowsingAdultDNSv4, PingerHelper.CleanBrowsingAdultDNSv6);
+                PingerHelper.GetActiveNetworkAdapters();
+                DisplayCurrentDNS();
+                return;
+            }
+        }
+
+        private void DisplayCurrentDNS()
+        {
+            _currentDNS = PingerHelper.GetDNSFromNetworkAdapter(PingerHelper.NetworkAdapters[boxAdapter.SelectedIndex]).ToArray();
+
+            try
+            {
+                if (_currentDNS.Length == 1)
+                {
+                    linkDNSv4.Text = _currentDNS[0];
+                }
+                else if (_currentDNS.Length == 2)
+                {
+                    linkDNSv4.Text = _currentDNS[0];
+                    linkDNSv4A.Text = _currentDNS[1];
+                }
+                else if (_currentDNS.Length == 3)
+                {
+                    linkDNSv6.Text = _currentDNS[0];
+                    linkDNSv4.Text = _currentDNS[1];
+                    linkDNSv4A.Text = _currentDNS[2];
+                }
+                else if (_currentDNS.Length == 4)
+                {
+                    linkDNSv4.Text = _currentDNS[2];
+                    linkDNSv4A.Text = _currentDNS[3];
+                    linkDNSv6.Text = _currentDNS[0];
+                    linkDNSv6A.Text = _currentDNS[1];
+                }
+            }
+            catch { }
+            finally { pingerTab.Focus(); }
+        }
+
+        private void boxAdapter_SelectedIndexChanged(object sender, EventArgs e)
+        {
+            LoadNetworkAdapterConfig();
+            pingerTab.Focus();
+        }
     }
 }

+ 2 - 2
Optimizer/Forms/MainForm.resx

@@ -715,7 +715,7 @@ any application only by typing your desired keyword.</value>
         AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
         LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
         ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAC8
-        GgAAAk1TRnQBSQFMAgEBCQEAAVgBBQFYAQUBIAEAASABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAGA
+        GgAAAk1TRnQBSQFMAgEBCQEAASgBBgEoAQYBIAEAASABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAGA
         AwABYAMAAQEBAAEgBgABwP8A/wD/AP8A/wD/AP8A/wAeAANHAYB0//8AiQADRwGAdP//AIkAAyoBQANH
         AYADRwGAA0cBgANHAYADRwGAA0cBgANHAYADRwGAA0cBgANHAYADRwGAA0cBgANHAYADRwGAA0cBgANH
         AYADRwGAA0cBgANHAYADRwGAA0cBgANHAYADRwGAA0cBgANHAYADRwGAA0cBgANHAYADRwGA/wD/AP8A
@@ -1615,7 +1615,7 @@ any application only by typing your desired keyword.</value>
 </value>
   </data>
   <metadata name="helpBox.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>427, 51</value>
+    <value>428, 51</value>
   </metadata>
   <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>94</value>

+ 1 - 1
Optimizer/Optimizer.csproj

@@ -189,6 +189,7 @@
     <Compile Include="NetworkMonitor.cs" />
     <Compile Include="Optimize.cs" />
     <Compile Include="Options.cs" />
+    <Compile Include="PingerHelper.cs" />
     <Compile Include="Program.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="Properties\Resources.Designer.cs">
@@ -293,7 +294,6 @@
     <None Include="Resources\Scripts\EnableXboxTasks.bat" />
     <None Include="Resources\i18n\EL.json" />
     <None Include="Resources\i18n\ES.json" />
-    <None Include="Resources\Scripts\FlushDNSCache.bat" />
     <None Include="Resources\i18n\FR.json" />
     <None Include="Resources\Scripts\GPEditEnablerInHome.bat" />
     <None Include="Resources\Scripts\hosts" />

+ 126 - 0
Optimizer/PingerHelper.cs

@@ -0,0 +1,126 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Net.NetworkInformation;
+using System.Net.Sockets;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Optimizer
+{
+    internal class PingerHelper
+    {
+        internal static string[] GoogleDNSv4 = { "8.8.8.8", "8.8.4.4" };
+        internal static string[] GoogleDNSv6 = { "2001:4860:4860::8888", "2001:4860:4860::8844" };
+
+        internal static string[] OpenDNSv4 = { "208.67.222.222", "208.67.220.220" };
+        internal static string[] OpenDNSv6 = { "2620:0:ccc::2", "2620:0:ccd::2" };
+
+        internal static string[] CloudflareDNSv4 = { "1.1.1.1", "1.0.0.1" };
+        internal static string[] CloudflareDNSv6 = { "2606:4700:4700::1111", "2606:4700:4700::1001" };
+
+        internal static string[] Quad9DNSv4 = { "9.9.9.9", "149.112.112.112" };
+        internal static string[] Quad9DNSv6 = { "2620:fe::fe", string.Empty };
+
+        internal static string[] CleanBrowsingDNSv4 = { "185.228.168.168", "185.228.168.169" };
+        internal static string[] CleanBrowsingDNSv6 = { "2a0d:2a00:1::", "2a0d:2a00:2::" };
+
+        internal static string[] CleanBrowsingAdultDNSv4 = { "185.228.168.10", "185.228.168.11" };
+        internal static string[] CleanBrowsingAdultDNSv6 = { "2a0d:2a00:1::1", "2a0d:2a00:2::1" };
+
+        internal static string[] AlternateDNSv4 = { "76.76.19.19", "76.223.122.150" };
+        internal static string[] AlternateDNSv6 = { "2602:fcbc::ad", "2602:fcbc:2::ad" };
+
+        internal static string[] AdguardDNSv4 = { "94.140.14.14", "94.140.15.15" };
+        internal static string[] AdguardDNSv6 = { "2a10:50c0::ad1:ff", "2a10:50c0::ad2:ff" };
+
+        internal static Ping pinger = new Ping();
+
+        internal static bool ShowHiddenAdapters = false;
+        internal static NetworkInterface[] NetworkAdapters = GetActiveNetworkAdapters();
+
+        static IPAddress addressToPing;
+
+        internal static NetworkInterface[] GetActiveNetworkAdapters()
+        {
+            if (ShowHiddenAdapters) NetworkAdapters = NetworkInterface.GetAllNetworkInterfaces();
+
+            if (!ShowHiddenAdapters) NetworkAdapters = NetworkInterface.GetAllNetworkInterfaces().Where(
+                a => a.OperationalStatus == OperationalStatus.Up &&
+                (a.NetworkInterfaceType == NetworkInterfaceType.Wireless80211 || a.NetworkInterfaceType == NetworkInterfaceType.Ethernet) &&
+                a.GetIPProperties().GatewayAddresses.Any(g => g.Address.AddressFamily.ToString() == "InterNetwork")).ToArray();
+
+            return NetworkAdapters;
+        }
+
+        internal static IEnumerable<string> GetDNSFromNetworkAdapter(NetworkInterface nic)
+        {
+            return nic.GetIPProperties().DnsAddresses.Select(z => z.ToString());
+        }
+
+        internal static void SetDNS(string nic, string[] dnsv4, string[] dnsv6)
+        {
+            string cmdv4Primary = $"netsh interface ipv4 set dnsservers {nic} static {dnsv4[0]} primary";
+            string cmdv4Alternate = $"netsh interface ipv4 add dnsservers {nic} {dnsv4[1]} index=2";
+
+            string cmdv6Primary = $"netsh interface ipv6 set dnsservers {nic} static {dnsv6[0]} primary";
+            string cmdv6Alternate = $"netsh interface ipv6 add dnsservers {nic} {dnsv6[1]} index=2";
+
+            Utilities.RunCommand(cmdv4Primary);
+            Utilities.RunCommand(cmdv4Alternate);
+            Utilities.RunCommand(cmdv6Primary);
+            Utilities.RunCommand(cmdv6Alternate);
+        }
+
+        internal static void ResetDefaultDNS(string nic)
+        {
+            string cmdv4 = $"netsh interface ipv4 set dnsservers {nic} dhcp";
+            string cmdv6 = $"netsh interface ipv6 set dnsservers {nic} dhcp";
+
+            Utilities.RunCommand(cmdv4);
+            Utilities.RunCommand(cmdv6);
+        }
+
+        internal static PingReply PingHost(string nameOrAddress)
+        {
+            PingReply reply;
+            try
+            {
+                addressToPing = Dns.GetHostAddresses(nameOrAddress).First(address => address.AddressFamily == AddressFamily.InterNetwork);
+
+                reply = pinger.Send(addressToPing);
+                return reply;
+            }
+            catch
+            {
+                return null;
+            }
+        }
+
+        internal static bool IsInternetAvailable()
+        {
+            const int timeout = 1000;
+            const string host = "1.1.1.1";
+
+            var ping = new Ping();
+            var buffer = new byte[32];
+            var pingOptions = new PingOptions();
+
+            try
+            {
+                var reply = ping.Send(host, timeout, buffer, pingOptions);
+                return (reply != null && reply.Status == IPStatus.Success);
+            }
+            catch (Exception)
+            {
+                return false;
+            }
+        }
+
+        internal static void FlushDNSCache()
+        {
+            Utilities.RunCommand("ipconfig /flushdns");
+        }
+    }
+}

+ 2 - 1
Optimizer/Program.cs

@@ -228,10 +228,11 @@ namespace Optimizer
                                     bool disableStartupTool = opts.Contains("startup");
                                     bool disableCleaner = opts.Contains("cleaner");
                                     bool disableIntegrator = opts.Contains("integrator");
+                                    bool disablePinger = opts.Contains("pinger");
 
                                     StartSplashForm();
 
-                                    _MainForm = new MainForm(_SplashForm, disableIndicium, disableHostsEditor, disableAppsTool, disableUWPTool, disableStartupTool, disableCleaner, disableIntegrator);
+                                    _MainForm = new MainForm(_SplashForm, disableIndicium, disableHostsEditor, disableAppsTool, disableUWPTool, disableStartupTool, disableCleaner, disableIntegrator, disablePinger);
                                     _MainForm.Load += MainForm_Load;
                                     Application.Run(_MainForm);
 

+ 0 - 10
Optimizer/Properties/Resources.Designer.cs

@@ -516,16 +516,6 @@ namespace Optimizer.Properties {
             }
         }
         
-        /// <summary>
-        ///   Looks up a localized string similar to ipconfig /flushdns
-        ///ipconfig /registerdns.
-        /// </summary>
-        internal static string FlushDNSCache {
-            get {
-                return ResourceManager.GetString("FlushDNSCache", resourceCulture);
-            }
-        }
-        
         /// <summary>
         ///   Looks up a localized string similar to {
         ///	&quot;btnAbout&quot;: &quot;OK&quot;,

+ 0 - 3
Optimizer/Properties/Resources.resx

@@ -187,9 +187,6 @@
   <data name="GPEditEnablerInHome" type="System.Resources.ResXFileRef, System.Windows.Forms">
     <value>..\Resources\Scripts\GPEditEnablerInHome.bat;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
   </data>
-  <data name="FlushDNSCache" type="System.Resources.ResXFileRef, System.Windows.Forms">
-    <value>..\Resources\Scripts\FlushDNSCache.bat;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
-  </data>
   <data name="ES" type="System.Resources.ResXFileRef, System.Windows.Forms">
     <value>..\Resources\i18n\ES.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
   </data>

+ 0 - 2
Optimizer/Required.cs

@@ -46,7 +46,6 @@ namespace Optimizer
             ScriptsFolder + "EnableXboxTasks.bat",
             ScriptsFolder + "OneDrive_Uninstaller.cmd",
             ScriptsFolder + "GPEditEnablerInHome.bat",
-            ScriptsFolder + "FlushDNSCache.bat",
             ScriptsFolder + "AddOpenWithCMD.reg"
         };
 
@@ -62,7 +61,6 @@ namespace Optimizer
             Properties.Resources.EnableXboxTasks,
             Encoding.UTF8.GetString(Properties.Resources.OneDrive_Uninstaller),
             Properties.Resources.GPEditEnablerInHome,
-            Properties.Resources.FlushDNSCache,
             Properties.Resources.AddOpenWithCMD
         };
 

+ 0 - 2
Optimizer/Resources/Scripts/FlushDNSCache.bat

@@ -1,2 +0,0 @@
-ipconfig /flushdns
-ipconfig /registerdns

+ 0 - 1
Optimizer/Resources/i18n/AR.json

@@ -112,7 +112,6 @@
 	"cleanerTitle": "تنظيف محرك النظام الخاص بك",
 	"pingerTitle": "عناوين Ping IP وتقييم وقت الاستجابة الخاص بك",
 	"lblPinger": "IP / اسم النطاق",
-	"lblDNS":  "موصى به Cloudflare DNS\n(انقر للنسخ)",
 	"btnOpenNetwork": "افتح اتصالات الشبكة",
 	"copyIPB": "نسخ",
 	"copyB": "نسخ IP",

+ 0 - 1
Optimizer/Resources/i18n/CN.json

@@ -112,7 +112,6 @@
 	"cleanerTitle": "清理您的系统驱动器",
 	"pingerTitle": "Ping IP地址和评估您的延迟",
 	"lblPinger": "IP / 域名",
-	"lblDNS": "推荐 Cloudflare DNS\n(单击复制)",
 	"btnOpenNetwork": "打开网络连接设置",
 	"copyIPB": "复制",
 	"copyB": "复制 IP",

+ 0 - 1
Optimizer/Resources/i18n/CZ.json

@@ -113,7 +113,6 @@
 	"cleanerTitle": "Vyčistit systémovou jednotku",
 	"pingerTitle": "Ping IP adres a vyhodnocení latence",
 	"lblPinger": "IP / Název domény",
-	"lblDNS": "Doporučeno Cloudflare DNS\n(kliknutím zkopírujete)",
 	"btnOpenNetwork": "Otevřít síťová připojení",
 	"copyIPB": "Kopírovat",
 	"copyB": "Zkopírovat IP",

+ 0 - 1
Optimizer/Resources/i18n/DE.json

@@ -113,7 +113,6 @@
 	"cleanerTitle": "Systemlaufwerk bereinigen",
 	"pingerTitle": "IP-Adressen anpingen und die Latenzzeit ermitteln",
 	"lblPinger": "IP / Domainname",
-	"lblDNS": "Empfohlene Cloudflare-DNS\n(zum kopieren anklicken)",
 	"btnOpenNetwork": "Netzwerkverbindungen öffnen",
 	"copyIPB": " Kopieren",
 	"copyB": "IP kopieren",

+ 0 - 1
Optimizer/Resources/i18n/EL.json

@@ -112,7 +112,6 @@
 	"cleanerTitle": "Καθαρισμός του δίσκου συστήματος",
 	"pingerTitle": "Διαγνωστικά ταχύτητας δικτύου",
 	"lblPinger": "IP / Όνομα ιστοσελίδας",
-	"lblDNS": "Προτεινόμενο Cloudflare DNS\n(πατήστε για αντιγραφή)",
 	"btnOpenNetwork": "Συνδέσεις Δικτύου",
 	"copyIPB": "Αντιγραφή",
 	"copyB": "Αντιγραφή IP",

+ 0 - 1
Optimizer/Resources/i18n/EN.json

@@ -111,7 +111,6 @@
 	"cleanerTitle": "Clean up your system drive",
 	"pingerTitle": "Ping IP addresses and assess your latency",
 	"lblPinger": "IP / Domain name",
-	"lblDNS": "Recommended Cloudflare DNS\n(click to copy)",
 	"btnOpenNetwork": "Open Network Connections",
 	"copyIPB": "Copy",
 	"copyB": "Copy IP",

+ 0 - 1
Optimizer/Resources/i18n/ES.json

@@ -113,7 +113,6 @@
 	"cleanerTitle": "Limpia la unidad de tu sistema",
 	"pingerTitle": "Haga ping a las IPs y evalúe su latencia",
 	"lblPinger": "IP / Domain name",
-	"lblDNS": "DNS de Cloudflare recomendado\n(haga clic para copiar)",
 	"btnOpenNetwork": "Conexiones de red abiertas",
 	"copyIPB": "Copiar",
 	"copyB": "Copiar IP",

+ 0 - 1
Optimizer/Resources/i18n/FR.json

@@ -113,7 +113,6 @@
 	"cleanerTitle": "Nettoyer votre disque systeme",
 	"pingerTitle": "Ping des adresses IP et evaluer votre latence",
 	"lblPinger": "IP / Nom de domaine",
-	"lblDNS": "Recommendation Cloudflare DNS\n(cliquez pour copier)",
 	"btnOpenNetwork": "Ouvrir les connexions reseau",
 	"copyIPB": "Copier",
 	"copyB": "Copier l'IP",

+ 0 - 1
Optimizer/Resources/i18n/IT.json

@@ -104,7 +104,6 @@
 	"cleanerTitle": "Clean up your system drive",
 	"pingerTitle": "Ping IP addresses and assess your latency",
 	"lblPinger": "IP / Domain name",
-	"lblDNS": "DNS Cloudflare consigliato\n(clicca per copiare)",
 	"btnOpenNetwork": "Apri connessioni di rete",
 	"copyIPB": "Copia",
 	"copyB": "Copia IP",

+ 0 - 1
Optimizer/Resources/i18n/KO.json

@@ -112,7 +112,6 @@
 	"cleanerTitle": "시스템 드라이브 청소",
 	"pingerTitle": "IP 주소 핑 및 대기 시간 평가",
 	"lblPinger": "IP / 도메인 이름",
-	"lblDNS": "Cloudflare DNS 권장\n(클릭해서 복사)",
 	"btnOpenNetwork": "네트워크 연결 열기",
 	"copyIPB": "복사",
 	"copyB": "IP 복사",

+ 0 - 1
Optimizer/Resources/i18n/PL.json

@@ -111,7 +111,6 @@
 	"cleanerTitle": "Wyczyść swój dysk systemowy",
 	"pingerTitle": "Pinguj adresy IP i określ opóźnienie",
 	"lblPinger": "IP / Nazwa Domeny",
-	"lblDNS": "Rekomendowany DNS Cloudflare\n(kliknij, aby skopiować)",
 	"btnOpenNetwork": "Otwórz 'Połączenia Sieciowe'",
 	"copyIPB": "Kopiuj",
 	"copyB": "Kopiuj IP",

+ 0 - 1
Optimizer/Resources/i18n/PT.json

@@ -113,7 +113,6 @@
 	"cleanerTitle": "Limpe a unidade do seu sistema",
 	"pingerTitle": "Faça ping em endereços IP e visualize sua latência",
 	"lblPinger": "Endereço IP / Nome do Domínio",
-	"lblDNS": "Cloudflare DNS recomendado\n(clique para copiar)",
 	"btnOpenNetwork": "Conexões de rede abertas",
 	"copyIPB": "Copiar",
 	"copyB": "Copiar IP",

+ 0 - 1
Optimizer/Resources/i18n/RU.json

@@ -112,7 +112,6 @@
 	"cleanerTitle": "Очистите системный диск",
 	"pingerTitle": "Пропингуйте IP-адреса и оцените задержку",
 	"lblPinger": "IP / Доменное имя(ссылка)",
-	"lblDNS": "Рекомендовано Cloudflare DNS\n(нажмите, чтобы скопировать)",
 	"btnOpenNetwork": "Открыть сетевые подключения",
 	"copyIPB": "Скопировать",
 	"copyB": "Скопировать IP",

+ 0 - 1
Optimizer/Resources/i18n/TR.json

@@ -113,7 +113,6 @@
 	"cleanerTitle": "Sistem sürücünüzü temizleyin",
 	"pingerTitle": "IP adreslerine ping atın ve gecikmenizi değerlendirin",
 	"lblPinger": "IP / Domain adı",
-	"lblDNS": "Önerilen Cloudflare DNS\n(kopyalamak için tıklayın)",
 	"btnOpenNetwork": "Ağ Bağlantılarını Aç",
 	"copyIPB": "Kopyala",
 	"copyB": "IP Kopyala",

+ 0 - 1
Optimizer/Resources/i18n/TW.json

@@ -113,7 +113,6 @@
 	"cleanerTitle": "清理您的系統驅動器",
 	"pingerTitle": "Ping IP位址和評估您的延遲",
 	"lblPinger": "IP / 域名",
-	"lblDNS": "推薦 Cloudflare DNS\n(單擊複製)",
 	"btnOpenNetwork": "打開網路連接設置",
 	"copyIPB": "複製",
 	"copyB": "複製 IP",

+ 1 - 48
Optimizer/Utilities.cs

@@ -36,10 +36,6 @@ namespace Optimizer
 
         internal static WindowsVersion CurrentWindowsVersion = WindowsVersion.Unsupported;
 
-        internal static Ping pinger = new Ping();
-
-        static IPAddress addressToPing;
-
         static string productName = string.Empty;
         static string buildNumber = string.Empty;
 
@@ -166,8 +162,8 @@ namespace Optimizer
             }
             return legit;
         }
-        // DEPRECATED
 
+        // DEPRECATED
         //internal static string GetEdgeDownloadFolder()
         //{
         //    string current = string.Empty;
@@ -673,49 +669,6 @@ namespace Optimizer
             return tcs.Task;
         }
 
-        internal static PingReply PingHost(string nameOrAddress)
-        {
-            PingReply reply;
-            try
-            {
-                addressToPing = Dns.GetHostAddresses(nameOrAddress)
-                    .First(address => address.AddressFamily == AddressFamily.InterNetwork);
-
-                reply = pinger.Send(addressToPing);
-                return reply;
-            }
-            catch
-            {
-                return null;
-            }
-        }
-
-        internal static bool IsInternetAvailable()
-        {
-            const int timeout = 1000;
-            const string host = "1.1.1.1";
-
-            var ping = new Ping();
-            var buffer = new byte[32];
-            var pingOptions = new PingOptions();
-
-            try
-            {
-                var reply = ping.Send(host, timeout, buffer, pingOptions);
-                return (reply != null && reply.Status == IPStatus.Success);
-            }
-            catch (Exception)
-            {
-                return false;
-            }
-        }
-
-        internal static void FlushDNSCache()
-        {
-            Utilities.RunBatchFile(Required.ScriptsFolder + "FlushDNSCache.bat");
-            //Utilities.RunCommand("ipconfig /release && ipconfig /renew && arp -d * && nbtstat -R && nbtstat -RR && ipconfig /flushdns && ipconfig /registerdns");
-        }
-
         internal static string SanitizeFileFolderName(string fileName)
         {
             char[] invalids = Path.GetInvalidFileNameChars();